mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-14 21:31:30 +08:00
chore: improve event flow (#14266)
This commit is contained in:
@@ -16,6 +16,7 @@ import { configureBrowserWorkbenchModule } from '@affine/core/modules/workbench'
|
||||
import { configureBrowserWorkspaceFlavours } from '@affine/core/modules/workspace-engine';
|
||||
import { getWorkerUrl } from '@affine/env/worker';
|
||||
import { StoreManagerClient } from '@affine/nbstore/worker/client';
|
||||
import { setTelemetryTransport } from '@affine/track';
|
||||
import { Framework, FrameworkRoot, getCurrentStore } from '@toeverything/infra';
|
||||
import { OpClient } from '@toeverything/infra/op';
|
||||
import { Suspense } from 'react';
|
||||
@@ -31,6 +32,7 @@ if (window.SharedWorker) {
|
||||
const worker = new Worker(workerUrl);
|
||||
storeManagerClient = new StoreManagerClient(new OpClient(worker));
|
||||
}
|
||||
setTelemetryTransport(storeManagerClient.telemetry);
|
||||
window.addEventListener('beforeunload', () => {
|
||||
storeManagerClient.dispose();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user