mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
chore: fix eslint in blocksuite (#9232)
This commit is contained in:
@@ -35,7 +35,7 @@ export class BlockComponent<
|
||||
@consume({ context: stdContext })
|
||||
accessor std!: BlockStdScope;
|
||||
|
||||
private _selected = computed(() => {
|
||||
private readonly _selected = computed(() => {
|
||||
const selection = this.std.selection.value.find(selection => {
|
||||
return selection.blockId === this.model?.id;
|
||||
});
|
||||
|
||||
@@ -108,13 +108,13 @@ export abstract class GfxBlockComponent<
|
||||
const parent = this.parentElement;
|
||||
|
||||
if (this.hasUpdated || !parent || !('scheduleUpdateChildren' in parent)) {
|
||||
super.scheduleUpdate();
|
||||
return super.scheduleUpdate();
|
||||
} else {
|
||||
await (parent.scheduleUpdateChildren as (id: string) => Promise<void>)(
|
||||
this.model.id
|
||||
);
|
||||
|
||||
super.scheduleUpdate();
|
||||
return super.scheduleUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,13 +207,13 @@ export function toGfxBlockComponent<
|
||||
const parent = this.parentElement;
|
||||
|
||||
if (this.hasUpdated || !parent || !('scheduleUpdateChildren' in parent)) {
|
||||
super.scheduleUpdate();
|
||||
return super.scheduleUpdate();
|
||||
} else {
|
||||
await (parent.scheduleUpdateChildren as (id: string) => Promise<void>)(
|
||||
this.model.id
|
||||
);
|
||||
|
||||
super.scheduleUpdate();
|
||||
return super.scheduleUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export class EditorHost extends SignalWatcher(
|
||||
}
|
||||
`;
|
||||
|
||||
private _renderModel = (model: BlockModel): TemplateResult => {
|
||||
private readonly _renderModel = (model: BlockModel): TemplateResult => {
|
||||
const { flavour } = model;
|
||||
const block = this.doc.getBlock(model.id);
|
||||
if (!block || block.blockViewType === BlockViewType.Hidden) {
|
||||
|
||||
@@ -6,7 +6,7 @@ export class ViewStore extends LifeCycleWatcher {
|
||||
|
||||
private readonly _blockMap = new Map<string, BlockComponent>();
|
||||
|
||||
private _fromId = (
|
||||
private readonly _fromId = (
|
||||
blockId: string | undefined | null
|
||||
): BlockComponent | null => {
|
||||
const id = blockId ?? this.std.doc.root?.id;
|
||||
|
||||
Reference in New Issue
Block a user