Skip to content

Commit

Permalink
fix: client-side state change triggered by update from backend
Browse files Browse the repository at this point in the history
When an empty slices property is received from the backend, but
the sliders property is not yet updated, the slider will add its
default value to the slices list, thereby changing the state
which gets synced back to the backend.

Fixes: spacetelescope/jdaviz#446
  • Loading branch information
mariobuikhuizen committed Feb 28, 2021
1 parent 7858147 commit 949842f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion glue_jupyter/common/state_widgets/viewer_image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
</div>
<div v-for="slider of sliders">
<v-subheader class="pl-0 slider-label">{{ slider.label }}: {{ glue_state.slices[slider.index] }} ({{ slider.world_value }} {{ slider.unit }})</v-subheader>
<glue-throttled-slider wait="300" :max="slider.max" :value.sync="glue_state.slices[slider.index]" hide-details />
<glue-throttled-slider
v-if="glue_state.slices && glue_state.slices.length > 0"
wait="300" :max="slider.max" :value.sync="glue_state.slices[slider.index]" hide-details />
</div>
</div>
</template>
Expand Down

0 comments on commit 949842f

Please sign in to comment.