feat: 💨
This commit is contained in:
@@ -171,8 +171,12 @@ class LocalStorageService {
|
||||
}
|
||||
|
||||
addAccount(account: TAccount) {
|
||||
this.accounts = this.accounts.filter((act) => !isSameAccount(act, account))
|
||||
const index = this.accounts.findIndex((act) => isSameAccount(act, account))
|
||||
if (index !== -1) {
|
||||
this.accounts[index] = account
|
||||
} else {
|
||||
this.accounts.push(account)
|
||||
}
|
||||
window.localStorage.setItem(StorageKey.ACCOUNTS, JSON.stringify(this.accounts))
|
||||
return account
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user