Skip to content

Commit

Permalink
setup_page: Don't reset visualisation in setup_page_by_state
Browse files Browse the repository at this point in the history
* Fixed bug where visualization shape is reset when navigating.

* Moved fix to setup_page.js
  • Loading branch information
wolfmanstout authored Aug 21, 2024
1 parent 889026e commit c2e33ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OZprivate/rawJS/OZTreeModule/src/navigation/setup_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ function setup_page_by_state(controller, state) {

// Change view type
// NB: In doing so, we implicitly rebuild the tree, which needs to happen regardless on init
return controller.change_view_type(state.vis_type, init).then(function () {
let p = (init || state.hasOwnProperty('vis_type')) ? controller.change_view_type(state.vis_type, init) : Promise.resolve()
return p.then(function () {
// Perform initial highlighting if asked
return state.hasOwnProperty('highlights') ? controller.highlight_replace(state.highlights) : null;
}).then(function () {
Expand Down Expand Up @@ -138,4 +139,3 @@ function tree_current_state_obj(controller, {record_popup = null}) {


export { setup_page_by_state, tree_current_state_obj };

0 comments on commit c2e33ab

Please sign in to comment.