Co-authored-by: Kagura Chen <daniyuu19@sjtu.edu.cn> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,8 +30,9 @@ interface ProviderState {
|
||||
defaultAccountId: string | null;
|
||||
loading: boolean;
|
||||
error: string | null;
|
||||
|
||||
|
||||
// Actions
|
||||
init: () => Promise<void>;
|
||||
refreshProviderSnapshot: () => Promise<void>;
|
||||
createAccount: (account: ProviderAccount, apiKey?: string) => Promise<void>;
|
||||
removeAccount: (accountId: string) => Promise<void>;
|
||||
@@ -74,7 +75,11 @@ export const useProviderStore = create<ProviderState>((set, get) => ({
|
||||
defaultAccountId: null,
|
||||
loading: false,
|
||||
error: null,
|
||||
|
||||
|
||||
init: async () => {
|
||||
await get().refreshProviderSnapshot();
|
||||
},
|
||||
|
||||
refreshProviderSnapshot: async () => {
|
||||
set({ loading: true, error: null });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user