mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 09:21:24 +08:00
fix(core): collections initialized logic (#5310)
Collections YArray should be initialized only when the user operates on it, local state can't be trusted
This commit is contained in:
@@ -193,9 +193,9 @@ export const pageCollectionBaseAtom =
|
||||
collections: workspaceSetting.collections,
|
||||
});
|
||||
};
|
||||
workspaceSetting.collectionsYArray.observe(fn);
|
||||
workspaceSetting.setting.observeDeep(fn);
|
||||
group.add(() => {
|
||||
workspaceSetting.collectionsYArray.unobserve(fn);
|
||||
workspaceSetting.setting.unobserveDeep(fn);
|
||||
});
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user