mirror of
https://github.com/desktop/desktop
synced 2024-09-12 21:01:16 +00:00
Immutability is nice
This commit is contained in:
parent
449e3b44ed
commit
c12437b66c
|
@ -30,10 +30,7 @@ export class UsersStore {
|
|||
public removeUser(user: User) {
|
||||
this.secureStore.deleteItem(getKeyForUser(user), user.login)
|
||||
|
||||
const index = this.users.findIndex(u => u.id === user.id)
|
||||
if (index > -1) {
|
||||
this.users.splice(index, 1)
|
||||
}
|
||||
this.users = this.users.filter(u => u.id !== user.id)
|
||||
|
||||
this.save()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue