diff --git a/manifest.json b/manifest.json index 012e6e3..63a8a02 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "ring-a-secretary", "name": "Ring a secretary", - "version": "0.0.4", + "version": "0.0.5", "minAppVersion": "0.15.0", "description": "Yet another ChatGPT-powered digital secretary", "author": "vorotamoroz", diff --git a/package-lock.json b/package-lock.json index 23bd239..4df284d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ring-a-secretary", - "version": "0.0.4", + "version": "0.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ring-a-secretary", - "version": "0.0.4", + "version": "0.0.5", "license": "MIT", "devDependencies": { "@types/node": "^16.11.6", diff --git a/package.json b/package.json index 1210cbc..f5ac4fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ring-a-secretary", - "version": "0.0.4", + "version": "0.0.5", "description": "Yet another ChatGPT-powered digital secretary", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index be44e7f..0607845 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,10 +78,10 @@ export default class RingASecretaryPlugin extends Plugin { async writeResponseToFile(response: string) { if (!this.processingFile) return; const file = this.processingFile; - await app.vault.process(file, (data) => { + await this.app.vault.process(file, (data) => { return data.replace(WAIT_MARK, response); }); - app.vault.trigger("modify", file); + this.app.vault.trigger("modify", file); this.processingFile = undefined; } @@ -112,7 +112,7 @@ export default class RingASecretaryPlugin extends Plugin { new Notice("Some question is already in progress... If not, please modify the code block directly.", 5000); return } - const f = app.vault.getAbstractFileByPath(sourcePath); + const f = this.app.vault.getAbstractFileByPath(sourcePath); if (!f) { new Notice("Could not find the file", 3000); return; @@ -130,7 +130,7 @@ export default class RingASecretaryPlugin extends Plugin { //Note: ESCAPE MARKDOWN? const newBody = `${dataMain}\n${roleUser}: ${text} \n${roleAssistant}: ${WAIT_MARK}`; - await app.vault.process(f, (data) => { + await this.app.vault.process(f, (data) => { const dataList = data.split("\n"); const dataBefore = dataList.slice(0, (secInfo?.lineStart ?? 0) + 1); @@ -145,7 +145,7 @@ export default class RingASecretaryPlugin extends Plugin { new Notice(`Something has been occurred: ${err?.message}`); }); }, 20); - app.vault.trigger("modify", f); + this.app.vault.trigger("modify", f); } submit.addEventListener("click", submitFunc, { signal: c.signal }); input.addEventListener("keydown", e => {