From 715da870a73146bb8e5a7e2cc1c4a6a94431ec98 Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Tue, 9 Apr 2019 17:15:01 +0200 Subject: [PATCH] sort the accounts array --- src/reducers/AccountsReducer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reducers/AccountsReducer.js b/src/reducers/AccountsReducer.js index e84452c3..14a9b275 100644 --- a/src/reducers/AccountsReducer.js +++ b/src/reducers/AccountsReducer.js @@ -75,6 +75,8 @@ const createAccount = (state: State, account: Account): State => { } const newState: State = [...state]; newState.push(account); + // sort the accounts array so the imported accounts always come before discovered accounts + newState.sort((a, b) => b.imported - a.imported || a.index - b.index); return newState; };