1717 type =" tertiary"
1818 @click =" openSharingSidebar" >
1919 <template #icon >
20- <LinkIcon v-if =" shareButtonType === Type.SHARE_TYPE_LINK " />
20+ <LinkIcon v-if =" shareButtonType === ShareType.Link " />
2121 <AccountPlusIcon v-else :size =" 20" />
2222 </template >
2323 </NcButton >
141141</template >
142142
143143<script lang="ts">
144- import type { ContentsWithRoot , INode } from ' @nextcloud/files'
144+ import type { ContentsWithRoot , Folder , INode } from ' @nextcloud/files'
145145import type { Upload } from ' @nextcloud/upload'
146146import type { CancelablePromise } from ' cancelable-promise'
147147import type { ComponentPublicInstance } from ' vue'
@@ -150,11 +150,11 @@ import type { UserConfig } from '../types.ts'
150150
151151import { getCapabilities } from ' @nextcloud/capabilities'
152152import { emit , subscribe , unsubscribe } from ' @nextcloud/event-bus'
153- import { Folder , Node , Permission , sortNodes , getFileListActions } from ' @nextcloud/files'
153+ import { Node , Permission , sortNodes , getFileListActions } from ' @nextcloud/files'
154154import { translate as t } from ' @nextcloud/l10n'
155155import { join , dirname , normalize } from ' path'
156156import { showError , showWarning } from ' @nextcloud/dialogs'
157- import { Type } from ' @nextcloud/sharing'
157+ import { ShareType } from ' @nextcloud/sharing'
158158import { UploadPicker , UploadStatus } from ' @nextcloud/upload'
159159import { loadState } from ' @nextcloud/initial-state'
160160import { defineComponent } from ' vue'
@@ -261,7 +261,7 @@ export default defineComponent({
261261 // non reactive data
262262 enableGridView ,
263263 forbiddenCharacters ,
264- Type ,
264+ ShareType ,
265265 }
266266 },
267267
@@ -391,22 +391,22 @@ export default defineComponent({
391391 return t (' files' , ' Share' )
392392 }
393393
394- if (this .shareButtonType === Type . SHARE_TYPE_LINK ) {
394+ if (this .shareButtonType === ShareType . Link ) {
395395 return t (' files' , ' Shared by link' )
396396 }
397397 return t (' files' , ' Shared' )
398398 },
399- shareButtonType(): Type | null {
399+ shareButtonType(): ShareType | null {
400400 if (! this .shareTypesAttributes ) {
401401 return null
402402 }
403403
404404 // If all types are links, show the link icon
405- if (this .shareTypesAttributes .some (type => type === Type . SHARE_TYPE_LINK )) {
406- return Type . SHARE_TYPE_LINK
405+ if (this .shareTypesAttributes .some (type => type === ShareType . Link )) {
406+ return ShareType . Link
407407 }
408408
409- return Type . SHARE_TYPE_USER
409+ return ShareType . User
410410 },
411411
412412 gridViewButtonLabel() {
@@ -454,7 +454,11 @@ export default defineComponent({
454454 if (action .enabled === undefined ) {
455455 return true
456456 }
457- return action .enabled (this .currentView , this .dirContents , { folder: this .currentFolder })
457+ return action .enabled (
458+ this .currentView ! ,
459+ this .dirContents ,
460+ { folder: this .currentFolder ! },
461+ )
458462 })
459463 .toSorted ((a , b ) => a .order - b .order )
460464 return enabledActions
0 commit comments