Fix setting lastAccessedAt on undefined

pull/1183/head
Lim Chee Aun 2025-06-02 08:11:02 +08:00
rodzic 3fb94e001e
commit 2bcc50fd28
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -11,6 +11,7 @@ export function saveAccounts(accounts) {
export function getAccount(id) {
const accounts = getAccounts();
const account = id ? accounts.find((a) => a.info.id === id) : accounts[0];
if (!account) return null;
account.lastAccessedAt = Date.now();
setTimeout(() => {
saveAccounts(accounts);