refactor: remove NoSsr on top level (#1951)

This commit is contained in:
Himself65
2023-04-14 17:07:41 -05:00
committed by GitHub
parent 43a96fe8e3
commit 2383165470
27 changed files with 211 additions and 133 deletions
@@ -3,7 +3,7 @@ import { useEffect } from 'react';
import { currentEditorAtom } from '../../atoms';
export function useReferenceLink(props?: {
export function useReferenceLinkEffect(props?: {
pageLinkClicked?: (params: { pageId: string }) => void;
subpageLinked?: (params: { pageId: string }) => void;
subpageUnlinked?: (params: { pageId: string }) => void;
@@ -15,10 +15,8 @@ export function useToggleWorkspacePublish(workspace: AffineWorkspace) {
public: isPublish,
});
await mutate(QueryKey.getWorkspaces);
// force update
jotaiStore.set(jotaiWorkspacesAtom, [
...jotaiStore.get(jotaiWorkspacesAtom),
]);
// fixme: remove force update
jotaiStore.set(jotaiWorkspacesAtom, ws => [...ws]);
},
[mutate, workspace.id]
);