Skip to content

Commit ce2b432

Browse files
committed
Remove initial data
1 parent f36c838 commit ce2b432

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

queries/useInboxProfileSocialsQuery.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ const inboxProfileSocialsQueryConfig = (inboxId: InboxId | undefined) => ({
5555
// And automatic retries if there was an error fetching
5656
refetchOnMount: false,
5757
staleTime: 1000 * 60 * 60 * 24,
58-
initialData: (): IProfileSocials[] | null | undefined => {
59-
if (!inboxId) {
60-
return undefined;
61-
}
62-
if (mmkv.contains(inboxProfileSocialsQueryStorageKey(inboxId))) {
63-
const data = JSON.parse(
64-
mmkv.getString(inboxProfileSocialsQueryStorageKey(inboxId))!
65-
) as IProfileSocials[];
66-
return data;
67-
}
68-
},
6958
initialDataUpdatedAt: 0,
7059
persister: profileSocialsPersister,
7160
});

queries/useProfileSocialsQuery.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ const profileSocialsQueryConfig = (peerAddress: string) => ({
5454
// And automatic retries if there was an error fetching
5555
refetchOnMount: false,
5656
staleTime: 1000 * 60 * 60 * 24,
57-
initialData: (): ProfileSocialsData => {
58-
if (mmkv.contains(profileSocialsQueryStorageKey(peerAddress))) {
59-
const data = JSON.parse(
60-
mmkv.getString(profileSocialsQueryStorageKey(peerAddress))!
61-
) as ProfileSocialsData;
62-
return data;
63-
}
64-
},
6557
initialDataUpdatedAt: 0,
6658
persister: profileSocialsPersister,
6759
});

queries/utils/persistence.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import mmkv from "@/utils/mmkv";
88
import logger from "@/utils/logger";
99
import { QueryState } from "@tanstack/query-core";
1010

11+
// Adds some types, otherwise everything is unknown
1112
export type GenericPersistedQuery<T, E = Error> = Omit<
1213
PersistedQuery,
1314
"state"

0 commit comments

Comments
 (0)