This commit is contained in:
Timothy Jaeryang Baek
2025-12-02 02:53:49 -05:00
parent 4f50571b53
commit 734c04ebf0
3 changed files with 11 additions and 31 deletions
+7 -20
View File
@@ -488,16 +488,9 @@
// handle channel created event
if (event.data?.type === 'channel:created') {
await channels.set(
(await getChannels(localStorage.token)).sort((a, b) =>
a.type === b.type
? 0
: a.type === 'dm'
? 1
: a.type === 'group'
? b.type === 'dm'
? -1
: 0
: -1
(await getChannels(localStorage.token)).sort(
(a, b) =>
['', null, 'group', 'dm'].indexOf(a.type) - ['', null, 'group', 'dm'].indexOf(b.type)
)
);
return;
@@ -539,16 +532,10 @@
);
} else {
await channels.set(
(await getChannels(localStorage.token)).sort((a, b) =>
a.type === b.type
? 0
: a.type === 'dm'
? 1
: a.type === 'group'
? b.type === 'dm'
? -1
: 0
: -1
(await getChannels(localStorage.token)).sort(
(a, b) =>
['', null, 'group', 'dm'].indexOf(a.type) -
['', null, 'group', 'dm'].indexOf(b.type)
)
);
}