|
@@ -47,6 +47,7 @@
|
|
|
import Loader from '../common/Loader.svelte';
|
|
|
import FilesOverlay from '../chat/MessageInput/FilesOverlay.svelte';
|
|
|
import AddFilesPlaceholder from '../AddFilesPlaceholder.svelte';
|
|
|
+ import { select } from 'd3-selection';
|
|
|
|
|
|
const BREAKPOINT = 768;
|
|
|
|
|
@@ -167,6 +168,20 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const tagEventHandler = async (type, tagName, chatId) => {
|
|
|
+ console.log(type, tagName, chatId);
|
|
|
+ if (type === 'delete') {
|
|
|
+ if (selectedTagName === tagName) {
|
|
|
+ if ($tags.map((t) => t.name).includes(tagName)) {
|
|
|
+ await chats.set(await getChatListByTagName(localStorage.token, tagName));
|
|
|
+ } else {
|
|
|
+ selectedTagName = null;
|
|
|
+ await initChatList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
let dragged = false;
|
|
|
|
|
|
const onDragOver = (e) => {
|
|
@@ -561,6 +576,10 @@
|
|
|
showDeleteConfirm = true;
|
|
|
}
|
|
|
}}
|
|
|
+ on:tag={(e) => {
|
|
|
+ const { type, name } = e.detail;
|
|
|
+ tagEventHandler(type, name, chat.id);
|
|
|
+ }}
|
|
|
/>
|
|
|
{/each}
|
|
|
</div>
|
|
@@ -616,6 +635,10 @@
|
|
|
showDeleteConfirm = true;
|
|
|
}
|
|
|
}}
|
|
|
+ on:tag={(e) => {
|
|
|
+ const { type, name } = e.detail;
|
|
|
+ tagEventHandler(type, name, chat.id);
|
|
|
+ }}
|
|
|
/>
|
|
|
{/each}
|
|
|
|