fix: show view icon in sidebar

This commit is contained in:
Shariq Ansari 2024-05-20 18:11:06 +05:30
parent 838e2085cf
commit 115400a1ee

View File

@ -115,7 +115,7 @@ import { viewsStore } from '@/stores/views'
import { notificationsStore } from '@/stores/notifications'
import { FeatherIcon } from 'frappe-ui'
import { useStorage } from '@vueuse/core'
import { computed } from 'vue'
import { computed, h } from 'vue'
const { getPinnedViews, getPublicViews } = viewsStore()
const { toggle: toggleNotificationPanel } = notificationsStore()
@ -196,7 +196,7 @@ function parseView(views) {
return views.map((view) => {
return {
label: view.label,
icon: getIcon(view.route_name),
icon: getIcon(view.route_name, view.icon),
to: {
name: view.route_name,
query: { view: view.name },
@ -205,7 +205,9 @@ function parseView(views) {
})
}
function getIcon(routeName) {
function getIcon(routeName, icon) {
if (icon) return h('div', icon)
switch (routeName) {
case 'Leads':
return LeadsIcon