UX: Add afterEnter/afterLeave handlers to merge dialog #5145 #5307 #5313

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2025-11-12 08:40:14 +01:00
parent 3916b503e6
commit 86d56454cd
2 changed files with 21 additions and 12 deletions

View file

@ -193,6 +193,18 @@ export default {
},
},
methods: {
afterEnter() {
this.$view.enter(this);
if (this.currentLat && this.currentLng && !(this.currentLat === 0 && this.currentLng === 0)) {
this.fetchLocationInfo(this.currentLat, this.currentLng);
}
},
afterLeave() {
this.location = null;
this.locationLoading = false;
this.resetSearchState();
this.$view.leave(this);
},
close() {
this.$emit("close");
},
@ -206,18 +218,6 @@ export default {
});
}
},
afterEnter() {
this.$view.enter(this);
if (this.currentLat && this.currentLng && !(this.currentLat === 0 && this.currentLng === 0)) {
this.fetchLocationInfo(this.currentLat, this.currentLng);
}
},
afterLeave() {
this.$view.leave(this);
this.location = null;
this.locationLoading = false;
this.resetSearchState();
},
onMarkerMoved(event) {
this.setPositionAndFetchInfo(event.lat, event.lng);
},

View file

@ -6,6 +6,8 @@
max-width="350"
class="p-dialog p-people-merge-dialog"
@keydown.esc.exact="close"
@after-enter="afterEnter"
@after-leave="afterLeave"
>
<v-card>
<v-card-title class="d-flex justify-start align-center ga-3">
@ -42,6 +44,7 @@ export default {
default: new Subject(),
},
},
emits: ["close", "confirm"],
data() {
return {};
},
@ -58,6 +61,12 @@ export default {
},
},
methods: {
afterEnter() {
this.$view.enter(this);
},
afterLeave() {
this.$view.leave(this);
},
close() {
this.$emit("close");
},