enh: filter by untagged chat

This commit is contained in:
Timothy J. Baek
2024-10-19 21:16:59 -07:00
parent 86999157de
commit 7476bcaa2b
3 changed files with 32 additions and 3 deletions

View File

@@ -197,6 +197,7 @@
return;
} else {
searchDebounceTimeout = setTimeout(async () => {
allChatsLoaded = false;
currentChatPage.set(1);
await chats.set(await getChatListBySearchText(localStorage.token, search));

View File

@@ -30,7 +30,13 @@
let filteredTags = [];
$: filteredTags = lastWord.startsWith('tag:')
? $tags.filter((tag) => {
? [
...$tags,
{
id: 'none',
name: $i18n.t('Untagged')
}
].filter((tag) => {
const tagName = lastWord.slice(4);
if (tagName) {
const tagId = tagName.replace(' ', '_').toLowerCase();