Browse Source

chore(gui-v2): fix types in LockMenu

pull/3044/head
braks 2 years ago
parent
commit
7c60ebd82c
  1. 11
      packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/LockMenu.vue

11
packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/LockMenu.vue

@ -1,8 +1,7 @@
<script lang="ts" setup>
import { computed } from '@vue/reactivity'
import { useToast } from 'vue-toastification'
import { useSmartsheetStoreOrThrow } from '~/composables/useSmartsheetStore'
import { extractSdkResponseErrorMsg } from '~/utils/errorUtils'
import { computed, useSmartsheetStoreOrThrow } from '#imports'
import { extractSdkResponseErrorMsg } from '~/utils'
import MdiLockOutlineIcon from '~icons/mdi/lock-outline'
import MdiAccountIcon from '~icons/mdi/account'
import MdiAccountGroupIcon from '~icons/mdi/account-group'
@ -25,19 +24,19 @@ function changeLockType(type: LockType) {
return toast.info('Coming soon', { timeout: 3000 })
}
try {
view.value.lock_type = type
;(view.value as any).lock_type = type
$api.dbView.update(view.value.id as string, {
lock_type: type,
})
toast.success(`Successfully Switched to ${type} view`, { timeout: 3000 })
} catch (e) {
} catch (e: any) {
toast.error(extractSdkResponseErrorMsg(e))
}
}
const Icon = computed(() => {
switch (view?.value?.lock_type) {
switch ((view.value as any).lock_type) {
case LockType.Personal:
return MdiAccountIcon
case LockType.Locked:

Loading…
Cancel
Save