1
0
mirror of https://github.com/spacebarchat/spacebarchat.git synced 2024-11-08 19:52:36 +01:00

🐛 fix notion duplicate insert

This commit is contained in:
Flam3rboy 2021-08-12 01:27:28 +02:00
parent c7701d2cba
commit 82d007b0a6

View File

@ -208,7 +208,8 @@ class GithubNotionSync {
}
} else {
console.log("adding new one");
this.allNotionPages.push(await this.notion.pages.create(options));
const index = this.allNotionPages.push(options) - 1; // directly insert it as they might be inserted twice if the webhook is triggered in very short amount of time
this.allNotionPages[index] = await this.notion.pages.create(options);
}
} catch (error) {
console.log(issue);