mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
style: enable no-non-null-assertion rule (#2723)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
This commit is contained in:
@@ -33,7 +33,7 @@ export const createBroadCastChannelProvider = (
|
||||
case 'doc:diff': {
|
||||
const [, diff, clientId] = event.data;
|
||||
const update = Y.encodeStateAsUpdate(doc, diff);
|
||||
broadcastChannel!.postMessage(['doc:update', update, clientId]);
|
||||
broadcastChannel?.postMessage(['doc:update', update, clientId]);
|
||||
break;
|
||||
}
|
||||
case 'doc:update': {
|
||||
@@ -47,7 +47,7 @@ export const createBroadCastChannelProvider = (
|
||||
const [, clientId] = event.data;
|
||||
const clients = getClients(awareness);
|
||||
const update = encodeAwarenessUpdate(awareness, clients);
|
||||
broadcastChannel!.postMessage(['awareness:update', update, clientId]);
|
||||
broadcastChannel?.postMessage(['awareness:update', update, clientId]);
|
||||
break;
|
||||
}
|
||||
case 'awareness:update': {
|
||||
|
||||
@@ -162,8 +162,7 @@ const sqliteOrigin = Symbol('sqlite-provider-origin');
|
||||
const createSQLiteProvider = (
|
||||
blockSuiteWorkspace: BlockSuiteWorkspace
|
||||
): SQLiteProvider => {
|
||||
const apis = window.apis!;
|
||||
const events = window.events!;
|
||||
const { apis, events } = window;
|
||||
// make sure it is being used in Electron with APIs
|
||||
assertExists(apis);
|
||||
assertExists(events);
|
||||
@@ -216,7 +215,7 @@ const createSQLiteProvider = (
|
||||
const createSQLiteDBDownloadProvider = (
|
||||
blockSuiteWorkspace: BlockSuiteWorkspace
|
||||
): SQLiteDBDownloadProvider => {
|
||||
const apis = window.apis!;
|
||||
const { apis } = window;
|
||||
let disconnected = false;
|
||||
|
||||
let _resolve: () => void;
|
||||
@@ -273,7 +272,7 @@ const createSQLiteDBDownloadProvider = (
|
||||
return;
|
||||
}
|
||||
|
||||
return window.apis?.db.addBlob(
|
||||
return apis?.db.addBlob(
|
||||
blockSuiteWorkspace.id,
|
||||
k,
|
||||
new Uint8Array(await blob.arrayBuffer())
|
||||
|
||||
Reference in New Issue
Block a user