fix: user channels issue
This commit is contained in:
1 parent
6fe737bf8f
commit
5c2df97f04
2 files changed
+38
-19
No files matched your search
@@ -182,12 +182,18 @@
|
||||
|
||||
const initChannels = async () => {
|
||||
// default (none), group, dm type
|
||||
await channels.set(
|
||||
(await getChannels(localStorage.token)).sort(
|
||||
(a, b) =>
|
||||
['', null, 'group', 'dm'].indexOf(a.type) - ['', null, 'group', 'dm'].indexOf(b.type)
|
||||
)
|
||||
);
|
||||
const res = await getChannels(localStorage.token).catch((error) => {
|
||||
return null;
|
||||
});
|
||||
|
||||
if (res) {
|
||||
await channels.set(
|
||||
res.sort(
|
||||
(a, b) =>
|
||||
['', null, 'group', 'dm'].indexOf(a.type) - ['', null, 'group', 'dm'].indexOf(b.type)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const initChatList = async () => {
|
||||
|
||||
Reference in new issue
Block a user