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

View file

@ -77,7 +77,7 @@
<div class="mx-2 mt-2"> <div class="mx-2 mt-2">
<Tooltip content={user?.status_message}> <Tooltip content={user?.status_message}>
<div <div
class="mb-1 w-full gap-2 px-2.5 py-1.5 rounded-xl bg-gray-50 dark:text-white dark:bg-gray-900/50 text-black transition text-xs flex items-center" class="w-full gap-2 px-2.5 py-1.5 rounded-xl bg-gray-50 dark:text-white dark:bg-gray-900/50 text-black transition text-xs flex items-center"
> >
{#if user?.status_emoji} {#if user?.status_emoji}
<div class=" self-center shrink-0"> <div class=" self-center shrink-0">

View file

@ -183,16 +183,9 @@
const initChannels = async () => { const initChannels = async () => {
// default (none), group, dm type // default (none), group, dm type
await channels.set( await channels.set(
(await getChannels(localStorage.token)).sort((a, b) => (await getChannels(localStorage.token)).sort(
a.type === b.type (a, b) =>
? 0 ['', null, 'group', 'dm'].indexOf(a.type) - ['', null, 'group', 'dm'].indexOf(b.type)
: a.type === 'dm'
? 1
: a.type === 'group'
? b.type === 'dm'
? -1
: 0
: -1
) )
); );
}; };

View file

@ -488,16 +488,9 @@
// handle channel created event // handle channel created event
if (event.data?.type === 'channel:created') { if (event.data?.type === 'channel:created') {
await channels.set( await channels.set(
(await getChannels(localStorage.token)).sort((a, b) => (await getChannels(localStorage.token)).sort(
a.type === b.type (a, b) =>
? 0 ['', null, 'group', 'dm'].indexOf(a.type) - ['', null, 'group', 'dm'].indexOf(b.type)
: a.type === 'dm'
? 1
: a.type === 'group'
? b.type === 'dm'
? -1
: 0
: -1
) )
); );
return; return;
@ -539,16 +532,10 @@
); );
} else { } else {
await channels.set( await channels.set(
(await getChannels(localStorage.token)).sort((a, b) => (await getChannels(localStorage.token)).sort(
a.type === b.type (a, b) =>
? 0 ['', null, 'group', 'dm'].indexOf(a.type) -
: a.type === 'dm' ['', null, 'group', 'dm'].indexOf(b.type)
? 1
: a.type === 'group'
? b.type === 'dm'
? -1
: 0
: -1
) )
); );
} }