From 2e914aa85340a3983bdd10b9580e0d2663973039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Mar 2026 17:23:32 +0800 Subject: [PATCH] Fix setTimeout losing this context by using arrow function Co-Authored-By: Claude Opus 4.6 --- src/stores/acctMgmt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/acctMgmt.ts b/src/stores/acctMgmt.ts index 5020f37..0a97388 100644 --- a/src/stores/acctMgmt.ts +++ b/src/stores/acctMgmt.ts @@ -152,7 +152,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', { if (response.status === 200) { this.isOneAccountJustCreate = true; this.justCreateUsername = userToCreate.username; - setTimeout(this.resetJustCreateFlag, JUST_CREATE_ACCOUNT_HOT_DURATION_MINS * 1000 * 60); + setTimeout(() => this.resetJustCreateFlag(), JUST_CREATE_ACCOUNT_HOT_DURATION_MINS * 1000 * 60); } } catch (error) { apiError(error, 'Failed to add a new account.');