From ef710a2631da9030679694827208113768641d2c Mon Sep 17 00:00:00 2001 From: Nachtalb Date: Fri, 30 Apr 2021 01:35:08 +0200 Subject: [PATCH] Revert obsolete changes to vuex store --- client/js/store.js | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/client/js/store.js b/client/js/store.js index b1f24d48..c9508fc8 100644 --- a/client/js/store.js +++ b/client/js/store.js @@ -17,23 +17,7 @@ function detectDesktopNotificationState() { return "blocked"; } -let store = null; - -const setMessageNetworkChannel = (message) => { - const channelAndNetwork = store.getters.findChannelOnNetwork( - message.networkUuid, - message.channelName - ); - - if (channelAndNetwork) { - message.network = channelAndNetwork.network; - message.channel = channelAndNetwork.channel; - } - - return message; -}; - -store = new Vuex.Store({ +const store = new Vuex.Store({ state: { appLoaded: false, activeChannel: null, @@ -135,23 +119,11 @@ store = new Vuex.Store({ state.messageSearchInProgress = value; }, messageSearchResults(state, value) { - if (value) { - // Set the search results and add networks and channels to messages - state.messageSearchResults = { - ...value, - ...value.results.map(setMessageNetworkChannel), - }; - return; - } - state.messageSearchResults = value; }, addMessageSearchResults(state, value) { // Append the search results and add networks and channels to new messages - value.results = [ - ...state.messageSearchResults.results, - ...value.results.map(setMessageNetworkChannel), - ]; + value.results = [...state.messageSearchResults.results, ...value.results]; state.messageSearchResults = value; },