Don't let user move faces unless marked

old-stable24
Varun Patil 2022-10-18 18:21:27 -07:00
parent 452e9d0d69
commit 09047eeb39
1 changed files with 7 additions and 1 deletions

View File

@ -33,7 +33,9 @@
<script lang="ts"> <script lang="ts">
import { Component, Emit, Mixins, Prop } from 'vue-property-decorator'; import { Component, Emit, Mixins, Prop } from 'vue-property-decorator';
import GlobalMixin from '../mixins/GlobalMixin'; import GlobalMixin from '../mixins/GlobalMixin';
import UserConfig from '../mixins/UserConfig';
import { showError } from '@nextcloud/dialogs'
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router'
import { NcActions, NcActionButton } from '@nextcloud/vue'; import { NcActions, NcActionButton } from '@nextcloud/vue';
import { translate as t, translatePlural as n } from '@nextcloud/l10n' import { translate as t, translatePlural as n } from '@nextcloud/l10n'
@ -65,7 +67,7 @@ type Selection = Map<number, IPhoto>;
CloseIcon, CloseIcon,
}, },
}) })
export default class SelectionHandler extends Mixins(GlobalMixin) { export default class SelectionHandler extends Mixins(GlobalMixin, UserConfig) {
@Prop() public selection: Selection; @Prop() public selection: Selection;
@Prop() public heads: { [dayid: number]: IHeadRow }; @Prop() public heads: { [dayid: number]: IHeadRow };
@ -336,6 +338,10 @@ export default class SelectionHandler extends Mixins(GlobalMixin) {
* Move selected photos to another person * Move selected photos to another person
*/ */
private async moveSelectionToPerson(selection: Selection) { private async moveSelectionToPerson(selection: Selection) {
if (!this.config_showFaceRect) {
showError(this.t('memories', 'You must enable "Mark person in preview" to use this feature'));
return;
}
(<any>this.$refs.faceMoveModal).open(Array.from(selection.values())); (<any>this.$refs.faceMoveModal).open(Array.from(selection.values()));
} }