Revert obsolete changes to vuex store

This commit is contained in:
Nachtalb 2021-04-30 01:35:08 +02:00
parent ddff3ac162
commit ef710a2631
No known key found for this signature in database
GPG key ID: E48DF13C07055D92

View file

@ -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;
},