fix: remove unintended change

This commit is contained in:
Alejandro Gomez
2023-01-28 12:57:09 +01:00
parent 456aa5fb79
commit e245a3931b

View File

@ -271,7 +271,20 @@ const LoginSlice = createSlice({
if (!Array.isArray(n)) { if (!Array.isArray(n)) {
n = [n]; n = [n];
} }
state.dms = n;
let didChange = false;
for (let x of n) {
if (!state.dms.some(a => a.id === x.id)) {
state.dms.push(x);
didChange = true;
}
}
if (didChange) {
state.dms = [
...state.dms
];
}
}, },
incDmInteraction: (state) => { incDmInteraction: (state) => {
state.dmInteraction += 1; state.dmInteraction += 1;