Reload image on change

This commit is contained in:
Willem Dantuma
2021-03-02 08:09:42 +01:00
parent 2f1c5210ea
commit cabdeaa875
5 changed files with 20 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ export class EditImageModalComponent implements OnInit {
this.imageService.putImage(this.endpointUrl,this.imageService.b64toBlob(body,"image/jpeg")).subscribe(() => {
this.changed.emit({});
});
(this.modal as any).close('Save click');
this,this.modalService.dismissAll("Save");
}
}
}

View File

@@ -1,4 +1,4 @@
import { Component,Input ,ViewChild,ElementRef} from '@angular/core';
import { Component,Input ,ViewChild,ElementRef,ChangeDetectorRef} from '@angular/core';
import { Store } from '@ngrx/store';
import { IListItem } from '../../models/list.item';
@@ -19,7 +19,7 @@ import { AppConfig } from "../../shared/app.config";
@ViewChild('thumbnail') el:ElementRef;
@ViewChild('modal') modal:EditImageModalComponent;
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,) {
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,private changeDetector:ChangeDetectorRef) {
}
getThumbnailUrl(item:IListItem):string {
@@ -53,6 +53,9 @@ import { AppConfig } from "../../shared/app.config";
}
onChanged() {
console.log("changed");
if(this.item) {
this.item.updated = new Date(new Date().getTime()).toISOString();
this.changeDetector.detectChanges();
}
}
}