Skip to content

Instantly share code, notes, and snippets.

@LefterisJP
Created February 4, 2020 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LefterisJP/1df9592102ef39a2ac98b870ff270f91 to your computer and use it in GitHub Desktop.
Save LefterisJP/1df9592102ef39a2ac98b870ff270f91 to your computer and use it in GitHub Desktop.
exchange_removal.diff
diff --git a/electron-app/src/store/balances/mutations.ts b/electron-app/src/store/balances/mutations.ts
index a66b08a..c3fe7b5 100644
--- a/electron-app/src/store/balances/mutations.ts
+++ b/electron-app/src/store/balances/mutations.ts
@@ -34,10 +34,11 @@ export const mutations: MutationTree<BalanceState> = {
state.connectedExchanges.push(exchangeName);
},
removeExchange(state: BalanceState, exchangeName: string) {
- const index = state.connectedExchanges.findIndex(
- value => value === exchangeName
- );
- state.connectedExchanges.splice(index, 1);
+ const exchanges = [...state.connectedExchanges];
+ const index = exchanges.findIndex(value => value === exchangeName);
+ // can't modify in place or else the vue reactivity does not work
+ exchanges.splice(index, 1);
+ state.connectedExchanges = exchanges;
},
addExchangeBalances(state: BalanceState, data: ExchangeInfo) {
const update: ExchangeData = {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment