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 authored and maartenbreddels committed Mar 2, 2021
1 parent 7858147 commit 0d9ebb8
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 0d9ebb8

Please sign in to comment.