refactor: uses of chats.set(...) support pagi sidebar
This commit is contained in:
@@ -25,7 +25,9 @@
|
||||
user,
|
||||
socket,
|
||||
showCallOverlay,
|
||||
tools
|
||||
tools,
|
||||
pageSkip,
|
||||
pageLimit
|
||||
} from '$lib/stores';
|
||||
import {
|
||||
convertMessagesToHistory,
|
||||
@@ -418,7 +420,9 @@
|
||||
params: params,
|
||||
files: chatFiles
|
||||
});
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
await chats.set(
|
||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -464,7 +468,9 @@
|
||||
params: params,
|
||||
files: chatFiles
|
||||
});
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
await chats.set(
|
||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -624,7 +630,9 @@
|
||||
tags: [],
|
||||
timestamp: Date.now()
|
||||
});
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
await chats.set(
|
||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||
);
|
||||
await chatId.set(chat.id);
|
||||
} else {
|
||||
await chatId.set('local');
|
||||
@@ -700,7 +708,8 @@
|
||||
})
|
||||
);
|
||||
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
await chats.set(await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit));
|
||||
|
||||
return _responses;
|
||||
};
|
||||
|
||||
@@ -947,7 +956,9 @@
|
||||
params: params,
|
||||
files: chatFiles
|
||||
});
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
await chats.set(
|
||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1220,7 +1231,9 @@
|
||||
params: params,
|
||||
files: chatFiles
|
||||
});
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
await chats.set(
|
||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1385,7 +1398,9 @@
|
||||
|
||||
if ($settings.saveChatHistory ?? true) {
|
||||
chat = await updateChatById(localStorage.token, _chatId, { title: _title });
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
await chats.set(
|
||||
await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user