Skip to content

Commit

Permalink
rename cache store
Browse files Browse the repository at this point in the history
  • Loading branch information
walteh committed Aug 13, 2024
1 parent 77f2ce7 commit 5018f60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/cache_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const cache_store = create(
} as CacheStoreState,
(set) => {
const loadUserData = async (ky: KyInstance, token: AccessTokenResponse) => {
if (localStorage.getItem("unthread.me/cache_store")) {
localStorage.removeItem("unthread.me/cache_store");
}

const prof = threadsapi.get_user_profile(ky, token).then((data) => {
set(() => ({
user_profile: data,
Expand Down Expand Up @@ -66,7 +70,7 @@ export const cache_store = create(
},
),
{
name: "unthread.me/cache_store",
name: "unthread.me/user_store",
storage: createJSONStorage(() => localStorage, {}),
version: 10,
},
Expand Down

0 comments on commit 5018f60

Please sign in to comment.