From fb34924ffebc0eb5ea9c9b219c0afbc799f704d0 Mon Sep 17 00:00:00 2001 From: Taka Date: Thu, 7 Feb 2019 17:55:27 +0000 Subject: [PATCH] Only reset the scenario once during startup. --- vasl_templates/webapp/static/main.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index 1ef372f..603a165 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -438,7 +438,12 @@ function init_snippet_button( $btn ) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -gPageLoadStatus = [ "main", "vehicle-listings", "ordnance-listings", "vehicle-notes", "ordnance-notes", "vasl-piece-info", "template-pack", "default-scenario" ] ; +gPageLoadStatus = [ + "main", + "vehicle-listings", "ordnance-listings", "reset-scenario", + "vehicle-notes", "ordnance-notes", + "vasl-piece-info", "template-pack", "default-scenario" +] ; function update_page_load_status( id ) { @@ -458,7 +463,10 @@ function update_page_load_status( id ) // NOTE: If the default scenario contains any vehicles or ordnance, it will look up the V/O listings, // so we need to wait until those have arrived. Note that while the default scenario will normally // be empty, having stuff in it is very useful during development. - do_on_new_scenario( false ) ; + if ( gPageLoadStatus.indexOf( "reset-scenario" ) !== -1 ) { + do_on_new_scenario( false ) ; + update_page_load_status( "reset-scenario" ) ; + } } function show_startup_msgs( msgs, msg_type ) {