Browse Source

fix(nc-gui): use computed on isShareBaseAllowed

pull/4482/head
Wing-Kam Wong 2 years ago
parent
commit
0625eacf72
  1. 16
      packages/nc-gui/components/general/ShareBaseButton.vue

16
packages/nc-gui/components/general/ShareBaseButton.vue

@ -7,19 +7,21 @@ const showUserModal = ref(false)
const { isUIAllowed } = useUIPermission()
const isShareBaseAllowed =
isUIAllowed('newUser') &&
route.name !== 'index' &&
route.name !== 'index-index-create' &&
route.name !== 'index-index-create-external' &&
route.name !== 'index-user-index'
const isShareBaseAllowed = computed(
() =>
isUIAllowed('newUser') &&
route.name !== 'index' &&
route.name !== 'index-index-create' &&
route.name !== 'index-index-create-external' &&
route.name !== 'index-user-index',
)
useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
if (e.altKey) {
switch (e.keyCode) {
case 73: {
// ALT + I
if (isShareBaseAllowed) {
if (isShareBaseAllowed.value) {
showUserModal.value = true
}
break

Loading…
Cancel
Save