refac
This commit is contained in:
1 parent
1111a3a222
commit
1457f2dec8
4 files changed
+92
-91
No files matched your search
@@ -55,7 +55,6 @@
|
||||
let orderBy = 'updated_at';
|
||||
let direction = 'desc'; // 'asc' or 'desc'
|
||||
|
||||
|
||||
$: if (chats) {
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -38,18 +38,18 @@
|
||||
if (folder && folder.id) {
|
||||
// Always use the shared folder endpoint so owners also see
|
||||
// chats created by users who have write access to this folder.
|
||||
const res = await getSharedFolderChats(localStorage.token, folder.id).catch(
|
||||
(error) => {
|
||||
console.error(error);
|
||||
return null;
|
||||
}
|
||||
);
|
||||
const res = await getSharedFolderChats(localStorage.token, folder.id).catch((error) => {
|
||||
console.error(error);
|
||||
return null;
|
||||
});
|
||||
if (res && res.chats) {
|
||||
chats = res.chats;
|
||||
allChatsLoaded = true;
|
||||
} else {
|
||||
// Fallback to regular API (e.g. if user has no shared access)
|
||||
const fallback = await getChatListByFolderId(localStorage.token, folder.id, page).catch(() => []);
|
||||
const fallback = await getChatListByFolderId(localStorage.token, folder.id, page).catch(
|
||||
() => []
|
||||
);
|
||||
chats = fallback || [];
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user