From e00ce22aadacc018846128182cfa67fae45fa5c4 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Mon, 2 Dec 2024 15:42:32 +1300 Subject: [PATCH] Replace into guild_active from homepage Allow user to change their mind about auto-create by redoing oauth flow. --- src/web/routes/oauth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/routes/oauth.js b/src/web/routes/oauth.js index 2f12dd1..82aebe4 100644 --- a/src/web/routes/oauth.js +++ b/src/web/routes/oauth.js @@ -86,7 +86,7 @@ as.router.get("/oauth", defineEventHandler(async event => { // Set auto-create for the guild // @ts-ignore if (managedGuilds.includes(parsedQuery.data.guild_id)) { - db.prepare("INSERT OR IGNORE INTO guild_active (guild_id, autocreate) VALUES (?, ?)").run(parsedQuery.data.guild_id, +!session.data.selfService) + db.prepare("REPLACE INTO guild_active (guild_id, autocreate) VALUES (?, ?)").run(parsedQuery.data.guild_id, +!session.data.selfService) } if (parsedQuery.data.guild_id) {