Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Silence warning about changing prop value
Browse files Browse the repository at this point in the history
  • Loading branch information
mutze85 committed Apr 4, 2019
1 parent 36808bc commit c3096e9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/scripts/js/es6/common/vuecomponents/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const TEMPLATE =`
<component
:is="tableComponentName"
:projectId="projectId"
:selectedIds="selectedIds"
:selectedIds="currentSelectedIds"
:componentState="initialTableState"
@selectItemsChanged="onSelectItemsChanged"
@componentStateChanged="onTableStateChanged"
Expand Down Expand Up @@ -44,6 +44,11 @@ Vue.component('flamenco-app', {
default: 'job'
}
},
data() {
return {
currentSelectedIds: this.selectedIds,
};
},
created() {
window.onpopstate = this.onPopState;
},
Expand Down Expand Up @@ -78,13 +83,13 @@ Vue.component('flamenco-app', {
onSelectItemsChanged(selectedJobs) {
let job = selectedJobs[0];
if (job) {
let userClickedInTable = this.selectedIds[0] !== job._id;
let userClickedInTable = this.currentSelectedIds[0] !== job._id;
if (userClickedInTable) {
item_open(job._id, 'job', true); // defined in 10_tasks.js
} else {
// item is already open
}
this.selectedIds = [job._id];
this.currentSelectedIds = [job._id];
}
},
/**
Expand All @@ -108,7 +113,7 @@ Vue.component('flamenco-app', {
onPopState(event) {
let state = event.state;
if (state && state.itemType === 'job') {
this.selectedIds = [state.itemId];
this.currentSelectedIds = [state.itemId];
}
defaultFlamencoPopstate(event);
}
Expand Down

0 comments on commit c3096e9

Please sign in to comment.