Line data Source code
1 : import { markRaw } from 'vue'
2 :
3 : import AssetsSidebarTab from '@/components/sidebar/tabs/AssetsSidebarTab.vue'
4 : import { useSettingStore } from '@/platform/settings/settingStore'
5 : import { useAssetsSidebarBadgeStore } from '@/stores/workspace/assetsSidebarBadgeStore'
6 : import type { SidebarTabExtension } from '@/types/extensionTypes'
7 :
8 2355 : export const useAssetsSidebarTab = (): SidebarTabExtension => {
9 2355 : return {
10 : id: 'assets',
11 : icon: 'icon-[comfy--image-ai-edit]',
12 : title: 'sideToolbar.assets',
13 : tooltip: 'sideToolbar.assets',
14 : label: 'sideToolbar.labels.assets',
15 : component: markRaw(AssetsSidebarTab),
16 : type: 'vue',
17 : iconBadge: () => {
18 : const settingStore = useSettingStore()
19 :
20 2095 : if (!settingStore.get('Comfy.Queue.QPOV2')) {
21 2083 : return null
22 : }
23 :
24 : const assetsSidebarBadgeStore = useAssetsSidebarBadgeStore()
25 12 : const count = assetsSidebarBadgeStore.unseenAddedAssetsCount
26 2095 : return count > 0 ? count.toString() : null
27 : }
28 : }
29 : }
|