Skip to content

Commit 69b5711

Browse files
committed
fixup! fix(files_sharing): remove slash from filename on unshare toast
1 parent e2566e7 commit 69b5711

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/files_sharing/src/mixins/SharesMixin.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,13 @@ export default {
291291
this.open = false
292292
await this.deleteShare(this.share.id)
293293
logger.debug('Share deleted', { shareId: this.share.id })
294+
const isTopLevel = (this.share.path.match(/\//g) || []).length <= 1
295+
const path = isTopLevel
296+
? this.share.path.replace(/^\//, '')
297+
: this.share.path
294298
const message = this.share.itemType === 'file'
295-
? t('files_sharing', 'File "{path}" has been unshared', { path: this.share.path.replaceAll('/', '') })
296-
: t('files_sharing', 'Folder "{path}" has been unshared', { path: this.share.path.replaceAll('/', '') })
299+
? t('files_sharing', 'File "{path}" has been unshared', { path })
300+
: t('files_sharing', 'Folder "{path}" has been unshared', { path })
297301
showSuccess(message)
298302
this.$emit('remove:share', this.share)
299303
await this.getNode()

0 commit comments

Comments
 (0)