Fix setTimeout losing this context by using arrow function

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 17:23:32 +08:00
parent 08d7402918
commit 2e914aa853

View File

@@ -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.');