From 3a0057d5e8c7fbf1701abbaeb4c23c9daf5a2c2f Mon Sep 17 00:00:00 2001 From: Michel Van den Bergh Date: Sun, 3 May 2020 15:00:38 +0200 Subject: [PATCH] A quick attempt at fixing https://github.com/glinscott/fishtest/issues/625#issuecomment-622998366 --- fishtest/fishtest/templates/tests_run.mak | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fishtest/fishtest/templates/tests_run.mak b/fishtest/fishtest/templates/tests_run.mak index f91c331a7..66b8cd510 100644 --- a/fishtest/fishtest/templates/tests_run.mak +++ b/fishtest/fishtest/templates/tests_run.mak @@ -328,9 +328,14 @@ update_sprt_bounds($(this).val()); }); - const initial_base_branch = $('#base-branch').val(); - const initial_base_signature = $('#base-signature').val(); + var initial_base_branch = $('#base-branch').val(); + var initial_base_signature = $('#base-signature').val(); + var spsa_do_not_save = false; $('.btn-group .btn').on('click', function() { + if(!spsa_do_not_save){ + initial_base_branch = $('#base-branch').val(); + initial_base_signature = $('#base-signature').val(); + } const $btn = $(this); $(this).parent().find('.btn').removeClass('btn-info'); $(this).addClass('btn-info'); @@ -366,11 +371,13 @@ $('#test-signature').on('input', function() { $('#base-signature').val($(this).val()); }) + spsa_do_not_save = true; } else { $('#base-branch').removeAttr('readonly').val(initial_base_branch); $('#base-signature').removeAttr('readonly').val(initial_base_signature); $('#test-branch').off('input'); $('#test-signature').off('input'); + spsa_do_not_save = false; } %endif if (stop_rule === 'sprt') {