Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:
port: ${{ secrets.SSH_PORT }}
envs: USE_PRIVATE,PRIVATE_API_ADDR,PRIVATE_API_AUTH,HIVESIGNER_SECRET,SEARCH_API_ADDR,SEARCH_API_SECRET,API_PORT
script: |
export USE_PRIVATE=$USE_PRIVATE
export NEXT_PUBLIC_USE_PRIVATE=$USE_PRIVATE
export PRIVATE_API_ADDR=$PRIVATE_API_ADDR
export PRIVATE_API_AUTH=$PRIVATE_API_AUTH
export HIVESIGNER_SECRET=$HIVESIGNER_SECRET
export NEXT_PUBLIC_HS_CLIENT_SECRET=$HIVESIGNER_SECRET
export SEARCH_API_ADDR=$SEARCH_API_ADDR
export SEARCH_API_SECRET=$SEARCH_API_SECRET
export API_PORT=$API_PORT
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
port: ${{ secrets.SSH_PORT }}
envs: USE_PRIVATE,PRIVATE_API_ADDR,PRIVATE_API_AUTH,HIVESIGNER_SECRET,SEARCH_API_ADDR,SEARCH_API_SECRET,API_PORT
script: |
export USE_PRIVATE=$USE_PRIVATE
export NEXT_PUBLIC_USE_PRIVATE=$USE_PRIVATE
export PRIVATE_API_ADDR=$PRIVATE_API_ADDR
export PRIVATE_API_AUTH=$PRIVATE_API_AUTH
export HIVESIGNER_SECRET=$HIVESIGNER_SECRET
export NEXT_PUBLIC_HS_CLIENT_SECRET=$HIVESIGNER_SECRET
export SEARCH_API_ADDR=$SEARCH_API_ADDR
export SEARCH_API_SECRET=$SEARCH_API_SECRET
export API_PORT=$API_PORT
Expand Down Expand Up @@ -134,10 +134,10 @@ jobs:
port: ${{ secrets.SSH_PORT }}
envs: USE_PRIVATE,PRIVATE_API_ADDR,PRIVATE_API_AUTH,HIVESIGNER_SECRET,SEARCH_API_ADDR,SEARCH_API_SECRET,API_PORT
script: |
export USE_PRIVATE=$USE_PRIVATE
export NEXT_PUBLIC_USE_PRIVATE=$USE_PRIVATE
export PRIVATE_API_ADDR=$PRIVATE_API_ADDR
export PRIVATE_API_AUTH=$PRIVATE_API_AUTH
export HIVESIGNER_SECRET=$HIVESIGNER_SECRET
export NEXT_PUBLIC_HS_CLIENT_SECRET=$HIVESIGNER_SECRET
export SEARCH_API_ADDR=$SEARCH_API_ADDR
export SEARCH_API_SECRET=$SEARCH_API_SECRET
export API_PORT=$API_PORT
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:
port: ${{ secrets.SSH_PORT }}
envs: USE_PRIVATE,PRIVATE_API_ADDR,PRIVATE_API_AUTH,HIVESIGNER_SECRET,SEARCH_API_ADDR,SEARCH_API_SECRET,API_PORT
script: |
export USE_PRIVATE=$USE_PRIVATE
export NEXT_PUBLIC_USE_PRIVATE=$USE_PRIVATE
export PRIVATE_API_ADDR=$PRIVATE_API_ADDR
export PRIVATE_API_AUTH=$PRIVATE_API_AUTH
export HIVESIGNER_SECRET=$HIVESIGNER_SECRET
export NEXT_PUBLIC_HS_CLIENT_SECRET=$HIVESIGNER_SECRET
export SEARCH_API_ADDR=$SEARCH_API_ADDR
export SEARCH_API_SECRET=$SEARCH_API_SECRET
export API_PORT=$API_PORT
Expand Down
201 changes: 100 additions & 101 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"@firebase/messaging": "^0.12.5",
"@hiveio/dhive": "^1.3.1-beta",
"@hiveio/hivescript": "^1.3.1",
"@iconscout/react-unicons": "^2.0.2",
"@popperjs/core": "^2.11.8",
"@react-spring/web": "^9.7.3",
"@tanstack/react-query": "^5.15.0",
"@tanstack/react-query-devtools": "^5.15.0",
"@tooni/iconscout-unicons-react": "^1.0.1",
"@webscopeio/react-textarea-autocomplete": "^4.9.2",
"axios": "^1.6.2",
"bs58": "^4.0.1",
Expand Down
1 change: 1 addition & 0 deletions src/api/queries/get-friends-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const getFriendsQuery = (
};
});
},
refetchOnMount: true,
initialData: { pages: [], pageParams: [] },
initialPageParam: { startFollowing: "" },
getNextPageParam: (lastPage) =>
Expand Down
19 changes: 9 additions & 10 deletions src/api/queries/get-subscriptions-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import { useQuery } from "@tanstack/react-query";
import { Subscription } from "@/entities";
import { bridgeApiCall } from "@/api/bridge";
import { QueryIdentifiers } from "@/core/react-query";
import { useGlobalStore } from "@/core/global-store";

export function useGetSubscriptionsQuery() {
const activeUser = useGlobalStore((state) => state.activeUser);

export function useGetSubscriptionsQuery(username?: string) {
return useQuery({
queryKey: [QueryIdentifiers.SUBSCRIPTIONS, activeUser?.username],
queryFn: () =>
bridgeApiCall<Subscription[] | null>("list_all_subscriptions", {
account: activeUser?.username
}),
enabled: !!activeUser
queryKey: [QueryIdentifiers.SUBSCRIPTIONS, username],
queryFn: async () => {
const response = await bridgeApiCall<Subscription[] | null>("list_all_subscriptions", {
account: username
});
return response ?? [];
},
enabled: !!username
});
}
19 changes: 15 additions & 4 deletions src/api/queries/image-downloader-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export function useImageDownloader(
noImage: string,
width: number,
height: number,
enabled: boolean
enabled: boolean,
useFallback = true
) {
const canUseWebp = useGlobalStore((state) => state.canUseWebp);

Expand All @@ -37,15 +38,25 @@ export function useImageDownloader(
const response = await appAxios.get(
canUseWebp
? catchPostImage(entry, width, height, "webp")
: catchPostImage(entry, width, height) || noImage,
: catchPostImage(entry, width, height),
{
responseType: "blob"
}
);
const data = (await blobToBase64(response.data)) as string;

return (await blobToBase64(response.data)) as string;
if (data) {
return data;
} else if (useFallback) {
const response = await appAxios.get(noImage, {
responseType: "blob"
});
return (await blobToBase64(response.data)) as string;
}

return "";
} catch (e) {
return noImage;
return useFallback ? noImage : "";
}
},
enabled,
Expand Down
Loading