From 3c45a3de0b453e4d4be5fbb16632ca4c272c184c Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Fri, 14 Jun 2019 23:48:07 -0400 Subject: [PATCH 01/29] better resilience of account selection --- src/app/states/accounts.state.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/app/states/accounts.state.ts b/src/app/states/accounts.state.ts index ae0be188..038caed9 100644 --- a/src/app/states/accounts.state.ts +++ b/src/app/states/accounts.state.ts @@ -44,22 +44,16 @@ export class AccountsState { @Action(SelectAccount) SelectAccount(ctx: StateContext, action: SelectAccount){ const state = ctx.getState(); - // const multiSelection = action.multiselection; + const selectedAccount = action.account; - - - // const copyAccounts = [...state.accounts]; - // copyAccounts - // .filter(x => x.id !== selectedAccount.id) - // .forEach(x => x.isSelected = false); - const oldSelectedAccount = state.accounts.find(x => x.isSelected); - if(selectedAccount.id === oldSelectedAccount.id) return; + if(oldSelectedAccount != null && selectedAccount.id === oldSelectedAccount.id) return; const acc = state.accounts.find(x => x.id === selectedAccount.id); acc.isSelected = true; - oldSelectedAccount.isSelected = false; + + if(oldSelectedAccount != null) oldSelectedAccount.isSelected = false; ctx.patchState({ accounts: [...state.accounts] From 8f540c48f82b61428f66fa834e5ba9b86d6cb944 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Sat, 15 Jun 2019 14:03:29 -0400 Subject: [PATCH 02/29] added avatar link in my profile --- .../manage-account.component.html | 36 ++++++++----------- .../manage-account.component.ts | 19 ++++++++++ src/app/models/account.models.ts | 4 --- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/app/components/floating-column/manage-account/manage-account.component.html b/src/app/components/floating-column/manage-account/manage-account.component.html index 37314bfb..2e52ec73 100644 --- a/src/app/components/floating-column/manage-account/manage-account.component.html +++ b/src/app/components/floating-column/manage-account/manage-account.component.html @@ -2,7 +2,9 @@

Manage Account

- - - - - -