Skip to content

Commit

Permalink
simple patch to avoid multiple errors for marked as done items
Browse files Browse the repository at this point in the history
  • Loading branch information
muness committed Dec 24, 2023
1 parent c43dabd commit f76d6f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default class AmazingMarvinPlugin extends Plugin {

settings: AmazingMarvinPluginSettings;
categories: Category[] = [];
markAsDoneAttempted: string[] = [];

createFolder = async (path: string) => {
try {
Expand Down Expand Up @@ -134,13 +135,18 @@ export default class AmazingMarvinPlugin extends Plugin {
}

async markDone(taskId: string) {
if (this.markAsDoneAttempted.includes(taskId)) {
return;
}

const opt = this.settings;
const requestBody = {
itemId: taskId,
timeZoneOffset: new Date().getTimezoneOffset()
};

try {
this.markAsDoneAttempted.push(taskId);
const remoteResponse = await requestUrl({
url: `https://serv.amazingmarvin.com/api/markDone`,
method: 'POST',
Expand Down

0 comments on commit f76d6f2

Please sign in to comment.