Mentions window: filter list when we part a chan
Should some other client part a chan, then we need to clean up the list from the mentions window in case it's open in ours.
This commit is contained in:
parent
0d209fce09
commit
e999171f29
@ -12,10 +12,14 @@ socket.on("part", function (data) {
|
||||
|
||||
const channel = store.getters.findChannel(data.chan);
|
||||
|
||||
if (channel) {
|
||||
channel.network.channels.splice(
|
||||
channel.network.channels.findIndex((c) => c.id === data.chan),
|
||||
1
|
||||
);
|
||||
if (!channel) {
|
||||
return;
|
||||
}
|
||||
|
||||
channel.network.channels.splice(
|
||||
channel.network.channels.findIndex((c) => c.id === data.chan),
|
||||
1
|
||||
);
|
||||
|
||||
store.dispatch("partChannel", channel);
|
||||
});
|
||||
|
@ -130,6 +130,12 @@ const store = new Vuex.Store({
|
||||
state.messageSearchResults = value;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
partChannel({commit, state}, netChan) {
|
||||
const mentions = state.mentions.filter((msg) => !(msg.chanId === netChan.channel.id));
|
||||
commit("mentions", mentions);
|
||||
},
|
||||
},
|
||||
getters: {
|
||||
findChannelOnCurrentNetwork: (state) => (name) => {
|
||||
name = name.toLowerCase();
|
||||
|
Loading…
Reference in New Issue
Block a user