From 1abd0357d72371bed48935b29687360f29675cce Mon Sep 17 00:00:00 2001 From: andryyy Date: Thu, 6 Feb 2020 07:03:03 +0100 Subject: [PATCH] [Web] Keep modal data when adding a sync job --- data/web/js/build/012-api.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/data/web/js/build/012-api.js b/data/web/js/build/012-api.js index dad65a7d..e8949927 100644 --- a/data/web/js/build/012-api.js +++ b/data/web/js/build/012-api.js @@ -255,14 +255,17 @@ $(document).ready(function() { }); if (unset === true) { unset = null; - $('form').formcache('clear'); - $('form').formcache('destroy'); - var i = localStorage.length; - while(i--) { - var key = localStorage.key(i); - if(/formcache/.test(key)) { - localStorage.removeItem(key); - } + // Keep form data for sync jobs + if (id != "add_syncjob") { + $('form').formcache('clear'); + $('form').formcache('destroy'); + var i = localStorage.length; + while(i--) { + var key = localStorage.key(i); + if(/formcache/.test(key)) { + localStorage.removeItem(key); + } + } } } else {