diff --git a/frontend/js/nfsen-ng.js b/frontend/js/nfsen-ng.js index f579936..b3f6bf4 100644 --- a/frontend/js/nfsen-ng.js +++ b/frontend/js/nfsen-ng.js @@ -341,9 +341,11 @@ $(document).ready(function() { var setButtonLoading = function($button, setTo = true) { $button.toggleClass('disabled', setTo); - if (setTo === false && $button.data('old-text') !== undefined) { - $button.html($button.data('old-text')); - $button.data('old-text', undefined); + if (setTo === false) { + if ($button.data('old-text') !== undefined) { + $button.html($button.data('old-text')); + $button.data('old-text', undefined); + } } else { $button.data('old-text', $button.html()); $button.html(' Loading…');