fix: do not allow pinning public views

This commit is contained in:
Shariq Ansari 2024-02-05 19:18:21 +05:30
parent 6f8078d33f
commit 21ba843ceb
2 changed files with 14 additions and 13 deletions

View File

@ -402,21 +402,22 @@ const viewActions = computed(() => {
]
if (route.query.view && (!view.value.public || isManager())) {
actions[0].items.push(
{
label: 'Rename',
icon: () => h(EditIcon, { class: 'h-4 w-4' }),
onClick: () => renameView(),
},
{
actions[0].items.push({
label: 'Rename',
icon: () => h(EditIcon, { class: 'h-4 w-4' }),
onClick: () => renameView(),
})
if (!view.value.public) {
actions[0].items.push({
label: view.value.pinned ? 'Unpin View' : 'Pin View',
icon: () =>
h(view.value.pinned ? UnpinIcon : PinIcon, { class: 'h-4 w-4' }),
onClick: () => pinView(),
}
)
})
}
if (route.query.view && isManager()) {
if (isManager()) {
actions[0].items.push({
label: view.value.public ? 'Make Private' : 'Make Public',
icon: () =>

View File

@ -25,9 +25,9 @@ export const usersStore = defineStore('crm-users', () => {
},
})
if (!users.data?.length) {
users.fetch()
}
// if (!users.data?.length) {
// users.fetch()
// }
function getUser(email) {
if (!email || email === 'sessionUser') {