feat: add infra code (#2718)

This commit is contained in:
Himself65
2023-06-08 09:41:20 +08:00
committed by GitHub
parent 4958d096b0
commit f3fd5ff76b
22 changed files with 283 additions and 16 deletions
-3
View File
@@ -50,10 +50,8 @@ rootWorkspacesMetadataAtom.onMount = setAtom => {
}, 0);
if (environment.isDesktop) {
// @ts-expect-error
window.apis?.workspace.list().then(workspaceIDs => {
if (abortController.signal.aborted) return;
// @ts-expect-error
const newMetadata = workspaceIDs.map(w => ({
id: w[0],
flavour: WorkspaceFlavour.LOCAL,
@@ -61,7 +59,6 @@ rootWorkspacesMetadataAtom.onMount = setAtom => {
setAtom(metadata => {
return [
...metadata,
// @ts-expect-error
...newMetadata.filter(m => !metadata.find(m2 => m2.id === m.id)),
];
});