mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 21:16:17 +02:00
restructure files onto electron-vite boilerplate
This commit is contained in:
@@ -3,27 +3,28 @@ import { nanoid } from 'nanoid/non-secure';
|
||||
import { create } from 'zustand';
|
||||
import { devtools, persist } from 'zustand/middleware';
|
||||
import { immer } from 'zustand/middleware/immer';
|
||||
|
||||
import { ServerListItem } from '/@/renderer/api/types';
|
||||
import { useAlbumArtistListDataStore } from '/@/renderer/store/album-artist-list-data.store';
|
||||
import { useAlbumListDataStore } from '/@/renderer/store/album-list-data.store';
|
||||
import { useListStore } from '/@/renderer/store/list.store';
|
||||
import { ServerListItem } from '/@/renderer/api/types';
|
||||
|
||||
export interface AuthState {
|
||||
currentServer: ServerListItem | null;
|
||||
deviceId: string;
|
||||
serverList: Record<string, ServerListItem>;
|
||||
}
|
||||
|
||||
export interface AuthSlice extends AuthState {
|
||||
actions: {
|
||||
addServer: (args: ServerListItem) => void;
|
||||
deleteServer: (id: string) => void;
|
||||
getServer: (id: string) => ServerListItem | null;
|
||||
setCurrentServer: (server: ServerListItem | null) => void;
|
||||
getServer: (id: string) => null | ServerListItem;
|
||||
setCurrentServer: (server: null | ServerListItem) => void;
|
||||
updateServer: (id: string, args: Partial<ServerListItem>) => void;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AuthState {
|
||||
currentServer: null | ServerListItem;
|
||||
deviceId: string;
|
||||
serverList: Record<string, ServerListItem>;
|
||||
}
|
||||
|
||||
export const useAuthStore = create<AuthSlice>()(
|
||||
persist(
|
||||
devtools(
|
||||
|
||||
Reference in New Issue
Block a user