concenrment history bug fix #2295

This commit is contained in:
Bachir Soussi Chiadmi 2023-10-02 09:55:25 +02:00
parent e032fd91a7
commit ad010e5c8d
3 changed files with 12 additions and 6 deletions

View File

@ -196,10 +196,12 @@ export default {
},
deep: true
},
active_revision: {
handler (n, o) {
// console.log(`concernementMapItem watch active_revision o:${o}, n:${n}`);
if(o & n){ // do not trigger on first variable filling (if o is null)
concernement: {
handler (n, o){
// check for active_revision changes
// do not trigger on first variable filling (if o is null)
if(o && o.active_revision && n.active_revision){
// console.log(`concernementMapItem watch concernement o.active_revision:${o.active_revision}, n.active_revision:${n.active_revision}`);
this.resetPaperActiveRevision();
}
},
@ -559,16 +561,19 @@ export default {
}
},
resetPaperActiveRevision(){
console.log('resetPaperActiveRevision');
this.getJarvisEnvelopeConvexe();
// remove contours if already exists
if (this.paper_main_object.children.contours) {
this.paper_main_object.children.contours.remove();
}
// redraw contours
this.paper_main_object.addChild(this.setPaperContour());
// remove entites if already exists
if (this.paper_main_object.children.entites) {
this.paper_main_object.children.entites.remove();
}
// redraw entites
this.paper_main_object.addChild(this.setPaperEntites());
},
clearPaperContents(){

View File

@ -94,8 +94,8 @@ export default {
watch: {
history_value: {
handler (n, o) {
console.log(`TerrainDeVie watch history_value o:${o}, n:${n}`);
this.setActiveRevision(this.concernement.id, n);
// console.log(`TerrainDeVie watch history_value o:${o}, n:${n}`);
this.setActiveRevision(this.cid, n);
},
deep: true
},

View File

@ -421,6 +421,7 @@ export const ConcernementsStore = defineStore({
this.recit_plyr_player = player;
},
setActiveRevision (cid, rid) {
// console.log(`setActiveRevision, cid:${cid}, rid:${rid}`);
this.concernementsByID[cid].active_revision = rid;
}