File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ import NcTextField from '@nextcloud/vue/components/NcTextField'
121121import NcIconSvgWrapper from ' @nextcloud/vue/components/NcIconSvgWrapper'
122122
123123import ' vue-advanced-cropper/dist/style.css'
124+ import type { LibreSignSignElementsConfig , NextcloudCapabilities } from ' ../../types/capabilities'
124125
125126type CropperResult = {
126127 canvas? : {
@@ -158,8 +159,8 @@ const emit = defineEmits<{
158159 (event : ' close' ): void
159160}>()
160161
161- const capabilities = getCapabilities ()
162- const signElementsConfig = capabilities ? .libresign ?.config ?.[' sign-elements' ] || {}
162+ const capabilities = getCapabilities () as NextcloudCapabilities
163+ const signElementsConfig: Partial < LibreSignSignElementsConfig > = capabilities .libresign ?.config ?.[' sign-elements' ] ?? {}
163164
164165const file = ref <HTMLInputElement | null >(null )
165166const cropper = ref <CropperInstance | null >(null )
@@ -175,8 +176,8 @@ const zoomLevel = ref(1)
175176const zoomMin = 0.1
176177const zoomMax = 8
177178const zoomStep = 0.1
178- const stencilBaseWidth = Number (signElementsConfig [' signature-width' ] || 0 )
179- const stencilBaseHeight = Number (signElementsConfig [' signature-height' ] || 0 )
179+ const stencilBaseWidth = Number (signElementsConfig [' signature-width' ] ?? 0 )
180+ const stencilBaseHeight = Number (signElementsConfig [' signature-height' ] ?? 0 )
180181
181182const hasImage = computed (() => !! image .value )
182183
You can’t perform that action at this time.
0 commit comments