mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat: implement 5chan-specific default board list
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface AutoSubscribeState {
|
||||
checkingAccounts: Set<string>;
|
||||
addCheckingAccount: (address: string) => void;
|
||||
removeCheckingAccount: (address: string) => void;
|
||||
isCheckingAccount: (address: string) => boolean;
|
||||
reset: () => void;
|
||||
}
|
||||
|
||||
export const useAutoSubscribeStore = create<AutoSubscribeState>((set, get) => ({
|
||||
checkingAccounts: new Set(),
|
||||
addCheckingAccount: (address) =>
|
||||
set((state) => ({
|
||||
checkingAccounts: new Set(state.checkingAccounts).add(address),
|
||||
})),
|
||||
removeCheckingAccount: (address) =>
|
||||
set((state) => {
|
||||
const newSet = new Set(state.checkingAccounts);
|
||||
newSet.delete(address);
|
||||
return { checkingAccounts: newSet };
|
||||
}),
|
||||
isCheckingAccount: (address) => get().checkingAccounts.has(address),
|
||||
reset: () => set({ checkingAccounts: new Set() }),
|
||||
}));
|
||||
Reference in New Issue
Block a user