mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
Split stores
This commit is contained in:
parent
2a858f3107
commit
b742b814c0
7 changed files with 200 additions and 122 deletions
|
|
@ -4,7 +4,7 @@ import create from 'zustand';
|
|||
import { devtools, persist } from 'zustand/middleware';
|
||||
import { immer } from 'zustand/middleware/immer';
|
||||
import { AlbumListSort, SortOrder } from '/@/renderer/api/types';
|
||||
import { useAppStore } from '/@/renderer/store/app.store';
|
||||
import { useAlbumStore } from '/@/renderer/store/album.store';
|
||||
import { ServerListItem } from '/@/renderer/types';
|
||||
|
||||
export interface AuthState {
|
||||
|
|
@ -45,15 +45,10 @@ export const useAuthStore = create<AuthSlice>()(
|
|||
state.currentServer = server;
|
||||
|
||||
if (server) {
|
||||
useAppStore.getState().actions.setPage('albums', {
|
||||
list: {
|
||||
...useAppStore.getState().albums.list,
|
||||
filter: {
|
||||
...useAppStore.getState().albums.list.filter,
|
||||
sortBy: AlbumListSort.RECENTLY_ADDED,
|
||||
sortOrder: SortOrder.ASC,
|
||||
},
|
||||
},
|
||||
useAlbumStore.getState().actions.setFilters({
|
||||
musicFolderId: undefined,
|
||||
sortBy: AlbumListSort.RECENTLY_ADDED,
|
||||
sortOrder: SortOrder.ASC,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue