fix: function binding

This commit is contained in:
Mo
2022-01-31 09:48:18 -06:00
parent c1f1aa4c8d
commit cf1720ba20

View File

@@ -407,7 +407,7 @@ export class NoteView extends PureComponent<Props, State> {
} }
} }
async dismissProtectedWarning() { dismissProtectedWarning = async () => {
let showNoteContents = true; let showNoteContents = true;
if (this.application.hasProtectionSources()) { if (this.application.hasProtectionSources()) {
showNoteContents = await this.application.authorizeNoteAccess(this.note); showNoteContents = await this.application.authorizeNoteAccess(this.note);
@@ -417,7 +417,7 @@ export class NoteView extends PureComponent<Props, State> {
} }
this.setShowProtectedOverlay(false); this.setShowProtectedOverlay(false);
this.focusTitle(); this.focusTitle();
} };
streamItems() { streamItems() {
this.removeComponentStreamObserver = this.application.streamItems( this.removeComponentStreamObserver = this.application.streamItems(
@@ -830,11 +830,11 @@ export class NoteView extends PureComponent<Props, State> {
}); });
} }
stackComponentExpanded(component: SNComponent): boolean { stackComponentExpanded = (component: SNComponent): boolean => {
return !!this.state.stackComponentViewers.find( return !!this.state.stackComponentViewers.find(
(viewer) => viewer.componentUuid === component.uuid (viewer) => viewer.componentUuid === component.uuid
); );
} };
toggleStackComponent = async (component: SNComponent) => { toggleStackComponent = async (component: SNComponent) => {
if (!component.isExplicitlyEnabledForItem(this.note.uuid)) { if (!component.isExplicitlyEnabledForItem(this.note.uuid)) {
@@ -882,7 +882,7 @@ export class NoteView extends PureComponent<Props, State> {
editor.scrollTop = this.scrollPosition; editor.scrollTop = this.scrollPosition;
}; };
onSystemEditorLoad(ref: HTMLTextAreaElement | null) { onSystemEditorLoad = (ref: HTMLTextAreaElement | null) => {
if (this.removeTabObserver || !ref) { if (this.removeTabObserver || !ref) {
return; return;
} }
@@ -961,7 +961,7 @@ export class NoteView extends PureComponent<Props, State> {
}); });
observer.observe(editor.parentElement as HTMLElement, { childList: true }); observer.observe(editor.parentElement as HTMLElement, { childList: true });
} };
render() { render() {
if (this.state.showProtectedWarning) { if (this.state.showProtectedWarning) {