diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 342f8b77..288ca578 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -124,6 +124,7 @@ export default class SelectionHandler extends Mixins(GlobalMixin, UserConfig) { name: t("memories", "Download"), icon: DownloadIcon, callback: this.downloadSelection.bind(this), + allowPublic: true, }, { name: t("memories", "Favorite"), @@ -190,7 +191,7 @@ export default class SelectionHandler extends Mixins(GlobalMixin, UserConfig) { /** Get the actions list */ private getActions(): ISelectionAction[] { - return this.defaultActions.filter((a) => !a.if || a.if(this)); + return this.defaultActions.filter((a) => (!a.if || a.if(this)) && (!this.routeIsPublic() || a.allowPublic)); } /** Clear all selected photos */ @@ -411,6 +412,11 @@ export default class SelectionHandler extends Mixins(GlobalMixin, UserConfig) { return this.config_albumsEnabled && this.$route.name === "albums"; } + /** Public route that can't modify anything */ + private routeIsPublic() { + return this.$route.name === "folder-share"; + } + /** * Move selected photos to album */ diff --git a/src/types.ts b/src/types.ts index f721d5b7..d59a3a33 100644 --- a/src/types.ts +++ b/src/types.ts @@ -206,4 +206,6 @@ export type ISelectionAction = { callback: (selection: Map) => Promise; /** Condition to check for including */ if?: (self?: any) => boolean; + /** Allow for public routes (default false) */ + allowPublic?: boolean; };