Add settings for experimental features
All checks were successful
CI / Lint (pull_request) Successful in 31s
CI / Test (pull_request) Successful in 59s

This commit is contained in:
2026-05-13 11:34:32 +02:00
parent 7bab8dfa09
commit 4390b7d699
7 changed files with 77 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ const GalleryContent = <template>
type="button"
{{on "click" (fn @copyEventId closeMenu)}}
>Copy Photo Event ID</button>
{{#if @isCreator}}
{{#if @canDeletePhoto}}
<button
class="dropdown-item text-danger"
type="button"
@@ -91,6 +91,7 @@ export default class PhotoGallery extends Component {
@service nostrData;
@service nostrRelay;
@service blossom;
@service settings;
@tracked currentPhoto = this.args.selectedPhoto || this.args.photos?.[0];
@@ -102,6 +103,12 @@ export default class PhotoGallery extends Component {
);
}
get canDeletePhoto() {
return (
this.isCreator && this.settings.experimentalEnablePhotoDeletion === true
);
}
bindKeyboard = modifier((element, [handler]) => {
document.addEventListener('keydown', handler);
return () => document.removeEventListener('keydown', handler);
@@ -254,7 +261,7 @@ export default class PhotoGallery extends Component {
@bindKeyboard={{this.bindKeyboard}}
@handleKeydown={{this.handleKeydown}}
@copyEventId={{this.copyEventId}}
@isCreator={{this.isCreator}}
@canDeletePhoto={{this.canDeletePhoto}}
@deletePhotoTask={{this.deletePhotoTask}}
@handleClose={{this.handleClose}}
@photos={{@photos}}
@@ -270,7 +277,7 @@ export default class PhotoGallery extends Component {
@bindKeyboard={{this.bindKeyboard}}
@handleKeydown={{this.handleKeydown}}
@copyEventId={{this.copyEventId}}
@isCreator={{this.isCreator}}
@canDeletePhoto={{this.canDeletePhoto}}
@deletePhotoTask={{this.deletePhotoTask}}
@handleClose={{this.handleClose}}
@photos={{@photos}}