mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): local workspace collections (#4378)
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
// todo
|
||||
export function useLocationTitle(): string {
|
||||
return 'AFFiNE';
|
||||
}
|
||||
@@ -93,14 +93,15 @@ const pageCollectionBaseAtom = atomWithObservable<Collection[]>(get => {
|
||||
// initial value
|
||||
subscriber.next([]);
|
||||
if (useLocalStorage) {
|
||||
getCollections(localCRUD).then(collections => {
|
||||
subscriber.next(collections);
|
||||
});
|
||||
const fn = () => {
|
||||
getCollections(localCRUD).then(collections => {
|
||||
subscriber.next(collections);
|
||||
getCollections(localCRUD).then(async collections => {
|
||||
const workspaceId = (await currentWorkspacePromise).id;
|
||||
subscriber.next(
|
||||
collections.filter(c => c.workspaceId === workspaceId)
|
||||
);
|
||||
});
|
||||
};
|
||||
fn();
|
||||
callbackSet.add(fn);
|
||||
return () => {
|
||||
callbackSet.delete(fn);
|
||||
|
||||
Reference in New Issue
Block a user