Recheck on state change

pull/37/head
Varun Patil 2022-09-12 22:39:32 -07:00
parent 7138768551
commit 2b212543d5
4 changed files with 13 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -38,7 +38,7 @@
</template>
<script lang="ts">
import { Component, Prop, Emit, Mixins } from 'vue-property-decorator';
import { Component, Prop, Emit, Mixins, Watch } from 'vue-property-decorator';
import { IDay, IPhoto } from "../types";
import * as dav from "../services/DavRequests";
@ -53,6 +53,7 @@ export default class Photo extends Mixins(GlobalMixin) {
@Prop() data: IPhoto;
@Prop() rowHeight: number;
@Prop() day: IDay;
@Prop() state: number;
@Emit('reprocess') emitReprocess(remIds: Set<number>, updatedDays: Set<IDay>) {}
@Emit('select') emitSelect(data: IPhoto) {}
@ -77,7 +78,8 @@ export default class Photo extends Mixins(GlobalMixin) {
return getPreviewUrl(this.data.fileid, this.data.etag);
}
mounted() {
@Watch('state')
stateChange() {
// Check if current image already loaded
if (this.data?.fileid) {
const img = this.$refs.image as HTMLImageElement;

View File

@ -22,9 +22,13 @@
<div class="photo" v-for="photo of item.photos" :key="photo.fileid">
<Folder v-if="photo.isfolder"
:data="photo" :rowHeight="rowHeight" />
:data="photo"
:rowHeight="rowHeight" />
<Photo v-else
:data="photo" :rowHeight="rowHeight" :day="item.day"
:data="photo"
:rowHeight="rowHeight"
:day="item.day"
:state="state"
@select="selectPhoto"
@reprocess="deleteFromViewWithAnimation"
@clickImg="clickPhoto" />