Hide selection menus on public link
parent
4c66ef1949
commit
ed8ae2cce1
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -206,4 +206,6 @@ export type ISelectionAction = {
|
|||
callback: (selection: Map<number, IPhoto>) => Promise<void>;
|
||||
/** Condition to check for including */
|
||||
if?: (self?: any) => boolean;
|
||||
/** Allow for public routes (default false) */
|
||||
allowPublic?: boolean;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue