wip: native notification

This commit is contained in:
Ren Amamiya
2023-05-30 15:33:27 +07:00
parent b856c2b8b5
commit 1e5bd7e21f
7 changed files with 59 additions and 18 deletions

View File

@@ -1,12 +1,17 @@
import { getActiveAccount } from "@utils/storage";
import { getActiveAccount, getLastLogin } from "@utils/storage";
import { create } from "zustand";
export const useActiveAccount = create((set) => ({
account: null,
lastLogin: 0,
fetch: async () => {
const response = await getActiveAccount();
set({ account: response });
},
fetchLastLogin: async () => {
const response = await getLastLogin();
set({ lastLogin: parseInt(response) });
},
updateFollows: (list: any) => {
set((state: any) => ({ account: { ...state.account, follows: list } }));
},