Skip to content

Commit

Permalink
fix(systemtags): no bulk action on public pages
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Oct 29, 2024
1 parent 1940b4f commit 569f235
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions apps/systemtags/src/files_actions/bulkSystemTagsAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import { type Node } from '@nextcloud/files'

import { defineAsyncComponent } from 'vue'
import { getCurrentUser } from '@nextcloud/auth'
import { FileAction } from '@nextcloud/files'
import { isPublicShare } from '@nextcloud/sharing/public'
import { spawnDialog } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'

Expand All @@ -30,12 +30,16 @@ export const action = new FileAction({

// If the app is disabled, the action is not available anyway
enabled(nodes) {
if (isPublicShare()) {
return false
}

if (nodes.length === 0) {
return false
}

// If the user is not logged in, the action is not available
return getCurrentUser() !== null
return true
},

async exec(node: Node) {
Expand Down
4 changes: 2 additions & 2 deletions dist/systemtags-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/systemtags-init.js.map

Large diffs are not rendered by default.

0 comments on commit 569f235

Please sign in to comment.