mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 20:41:50 +08:00
chore: fix eslint in blocksuite (#9232)
This commit is contained in:
@@ -112,13 +112,13 @@ export class AttachmentViewerPanel extends SignalWatcher(
|
||||
}
|
||||
`;
|
||||
|
||||
#cursor = signal<number>(0);
|
||||
readonly #cursor = signal<number>(0);
|
||||
|
||||
#docInfo = signal<DocInfo | null>(null);
|
||||
readonly #docInfo = signal<DocInfo | null>(null);
|
||||
|
||||
#fileInfo = signal<FileInfo | null>(null);
|
||||
readonly #fileInfo = signal<FileInfo | null>(null);
|
||||
|
||||
#state = signal<State>(State.Connecting);
|
||||
readonly #state = signal<State>(State.Connecting);
|
||||
|
||||
#worker: Worker | null = null;
|
||||
|
||||
|
||||
@@ -65,21 +65,21 @@ export class CollabDebugMenu extends SignalWatcher(ShadowlessElement) {
|
||||
}
|
||||
`;
|
||||
|
||||
private _darkModeChange = (e: MediaQueryListEvent) => {
|
||||
private readonly _darkModeChange = (e: MediaQueryListEvent) => {
|
||||
this._setThemeMode(!!e.matches);
|
||||
};
|
||||
|
||||
private _handleDocsPanelClose = () => {
|
||||
private readonly _handleDocsPanelClose = () => {
|
||||
this.leftSidePanel.toggle(this.docsPanel);
|
||||
};
|
||||
|
||||
private _keydown = (e: KeyboardEvent) => {
|
||||
private readonly _keydown = (e: KeyboardEvent) => {
|
||||
if (e.key === 'F1') {
|
||||
this._switchEditorMode();
|
||||
}
|
||||
};
|
||||
|
||||
private _startCollaboration = async () => {
|
||||
private readonly _startCollaboration = async () => {
|
||||
if (window.wsProvider) {
|
||||
notify('There is already a websocket provider exists', 'neutral').catch(
|
||||
console.error
|
||||
|
||||
@@ -188,11 +188,11 @@ export class StarterDebugMenu extends ShadowlessElement {
|
||||
}
|
||||
`;
|
||||
|
||||
private _darkModeChange = (e: MediaQueryListEvent) => {
|
||||
private readonly _darkModeChange = (e: MediaQueryListEvent) => {
|
||||
this._setThemeMode(!!e.matches);
|
||||
};
|
||||
|
||||
private _handleDocsPanelClose = () => {
|
||||
private readonly _handleDocsPanelClose = () => {
|
||||
this.leftSidePanel.toggle(this.docsPanel);
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,10 @@ import type { WebSocketMessage } from './types';
|
||||
type AwarenessChanges = Record<'added' | 'updated' | 'removed', number[]>;
|
||||
|
||||
export class WebSocketAwarenessSource implements AwarenessSource {
|
||||
private _onAwareness = (changes: AwarenessChanges, origin: unknown) => {
|
||||
private readonly _onAwareness = (
|
||||
changes: AwarenessChanges,
|
||||
origin: unknown
|
||||
) => {
|
||||
if (origin === 'remote') return;
|
||||
|
||||
const changedClients = Object.values(changes).reduce((res, cur) =>
|
||||
@@ -31,7 +34,7 @@ export class WebSocketAwarenessSource implements AwarenessSource {
|
||||
);
|
||||
};
|
||||
|
||||
private _onWebSocket = (event: MessageEvent<string>) => {
|
||||
private readonly _onWebSocket = (event: MessageEvent<string>) => {
|
||||
const data = JSON.parse(event.data) as WebSocketMessage;
|
||||
|
||||
if (data.channel !== 'awareness') return;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { diffUpdate, encodeStateVectorFromUpdate, mergeUpdates } from 'yjs';
|
||||
import type { WebSocketMessage } from './types';
|
||||
|
||||
export class WebSocketDocSource implements DocSource {
|
||||
private _onMessage = (event: MessageEvent<string>) => {
|
||||
private readonly _onMessage = (event: MessageEvent<string>) => {
|
||||
const data = JSON.parse(event.data) as WebSocketMessage;
|
||||
|
||||
if (data.channel !== 'doc') return;
|
||||
|
||||
Reference in New Issue
Block a user