From f76d6f228eabc9a65b6dd5d88b687490ff14f218 Mon Sep 17 00:00:00 2001 From: Muness Castle <931+muness@users.noreply.github.com> Date: Sat, 23 Dec 2023 20:34:57 -0500 Subject: [PATCH] simple patch to avoid multiple errors for marked as done items --- src/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.ts b/src/main.ts index 9f04bb0..4315d54 100644 --- a/src/main.ts +++ b/src/main.ts @@ -55,6 +55,7 @@ export default class AmazingMarvinPlugin extends Plugin { settings: AmazingMarvinPluginSettings; categories: Category[] = []; + markAsDoneAttempted: string[] = []; createFolder = async (path: string) => { try { @@ -134,6 +135,10 @@ export default class AmazingMarvinPlugin extends Plugin { } async markDone(taskId: string) { + if (this.markAsDoneAttempted.includes(taskId)) { + return; + } + const opt = this.settings; const requestBody = { itemId: taskId, @@ -141,6 +146,7 @@ export default class AmazingMarvinPlugin extends Plugin { }; try { + this.markAsDoneAttempted.push(taskId); const remoteResponse = await requestUrl({ url: `https://serv.amazingmarvin.com/api/markDone`, method: 'POST',