forceUpdate after photo load

pull/37/head
Varun Patil 2022-09-12 22:25:30 -07:00
parent b6e709b07b
commit 2618e3ff20
3 changed files with 15 additions and 4 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

@ -25,7 +25,7 @@
@click="click"
@error="error"
@load="data.flag |= c.FLAG_LOADED"
@load="load"
@contextmenu="contextmenu"
@touchstart="touchstart"
@ -71,11 +71,22 @@ export default class Photo extends Mixins(GlobalMixin) {
}
}
/** Image loaded successfully */
load() {
this.data.flag |= this.c.FLAG_LOADED;
this.$forceUpdate()
}
/** Error in loading image */
error(e: any) {
this.data.flag |= (this.c.FLAG_LOADED | this.c.FLAG_LOAD_FAIL);
}
/** Clear timers */
beforeUnmount() {
clearTimeout(this.touchTimer);
}
/** Pass to parent */
click() {
this.emitClickImg(this);