Created
February 4, 2020 15:01
-
-
Save LefterisJP/1df9592102ef39a2ac98b870ff270f91 to your computer and use it in GitHub Desktop.
exchange_removal.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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