comparison src/main.ts @ 51:e932f1b73133

Pass `this` as the context for various callbacks.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 02 Oct 2023 10:04:13 -0700
parents 1fe2cd2c603f
children 586f857a98dd
comparison
equal deleted inserted replaced
50:1fe2cd2c603f 51:e932f1b73133
124 124
125 this.data = Object.assign({}, DEFAULT_DATA); 125 this.data = Object.assign({}, DEFAULT_DATA);
126 126
127 await this.readStateDatabase(STATE_DB_PATH); 127 await this.readStateDatabase(STATE_DB_PATH);
128 128
129 this.registerEvent(this.app.workspace.on('file-open', this.onFileOpen)); 129 this.registerEvent(this.app.workspace.on('file-open', this.onFileOpen, this));
130 this.registerEvent(this.app.workspace.on('quit', this.onAppQuit)); 130 this.registerEvent(this.app.workspace.on('quit', this.onAppQuit, this));
131 this.registerEvent(this.app.vault.on('rename', this.onFileRename)); 131 this.registerEvent(this.app.vault.on('rename', this.onFileRename, this));
132 this.registerEvent(this.app.vault.on('delete', this.onFileDelete)); 132 this.registerEvent(this.app.vault.on('delete', this.onFileDelete, this));
133 133
134 this.app.workspace.onLayoutReady(() => { this.onLayoutReady(); }); 134 this.app.workspace.onLayoutReady(() => { this.onLayoutReady(); });
135 135
136 const _this = this; 136 const _this = this;
137 var uninstall = around(this.app.workspace, { 137 var uninstall = around(this.app.workspace, {