Skip to content

Commit

Permalink
Merge pull request #68 from wwi21seb-projekt/serveralpha_quickfix
Browse files Browse the repository at this point in the history
server alpha quickfix
  • Loading branch information
thommy3 authored Jul 4, 2024
2 parents ef0565a + e8a4600 commit 5b3605a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
5 changes: 4 additions & 1 deletion components/TextPostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ const TextPostCard: React.FC<Props> = (props) => {


const checkForHashtag = (text: string) => {
if(!text){
return
}
const hashtagRegex = /#(\w+)/g;
const segments = text.split(hashtagRegex);

Expand Down Expand Up @@ -541,7 +544,7 @@ const checkForHashtag = (text: string) => {
className={`h-72 mt-[-20px] ${postContent === "" ? "rounded-b-3xl" : "rounded-t-3xl"}`}
/>
</View> )}
{postContent != "" && (<Text className="my-3 mx-5">{checkForHashtag(postContent)}</Text>)}
{postContent !== "" && (<Text className="my-3 mx-5">{checkForHashtag(postContent)}</Text>)}


</View>
Expand Down
4 changes: 2 additions & 2 deletions env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// Beta Websocket: wss://server-beta.de/api/

// URL for development
export const baseUrl = "https://server-beta.de/api/";
export const baseUrl = "https://alpha.c930.net/api/";


// Websocket for development
export const baseSocketUrl = "wss://server-beta.de/api/";
export const baseSocketUrl = "wss://alpha.c930.net/api/";
16 changes: 12 additions & 4 deletions screens/FeedScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,22 @@ const FeedScreen = () => {
url += `&postId=${lastGlobalPostId}`;
}
}
let header;
if (token){
header = {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
}
} else {
header = {
"Content-Type": "application/json",
}
}

try {
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
headers: header,
});
if (response.ok) {
const data = await response.json();
Expand Down

0 comments on commit 5b3605a

Please sign in to comment.