diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md index e47533bd..e3bfc992 100644 --- a/changelog/60_UNRELEASED_2020-xx-xx.md +++ b/changelog/60_UNRELEASED_2020-xx-xx.md @@ -106,7 +106,6 @@ - Fixed that the assignment type "In alphabetic order" did not work correctly (the last person in the list was always assigned next once reached) (thanks @fipwmaqzufheoxq92ebc) ### Equipment improvements -- The equipment page now will never automatically reload, even when `Auto reload on external changes` is on and a change was detected (because you most probably have that page open longer to read the manual) (thanks @fipwmaqzufheoxq92ebc) - There is now a button to download the instruction manual (next to the "expand to fullscreen"-button) ### Calendar improvements/fixes diff --git a/public/js/grocy_dbchangedhandling.js b/public/js/grocy_dbchangedhandling.js index b92e7b3e..77ee6c0c 100644 --- a/public/js/grocy_dbchangedhandling.js +++ b/public/js/grocy_dbchangedhandling.js @@ -15,34 +15,31 @@ // Check if the database has changed once a minute // If a change is detected, reload the current page, but only if already idling for at least 50 seconds, // when there is no unsaved form data and when the user enabled auto reloading -if (Grocy.DbChangedHandlingEnabledForPage) +setInterval(function() { - setInterval(function() - { - Grocy.Api.Get('system/db-changed-time', - function(result) + Grocy.Api.Get('system/db-changed-time', + function(result) + { + var newDbChangedTime = moment(result.changed_time); + if (newDbChangedTime.isAfter(Grocy.DatabaseChangedTime)) { - var newDbChangedTime = moment(result.changed_time); - if (newDbChangedTime.isAfter(Grocy.DatabaseChangedTime)) + if (Grocy.IdleTime >= 50) { - if (Grocy.IdleTime >= 50) + if (BoolVal(Grocy.UserSettings.auto_reload_on_db_change) && $("form.is-dirty").length === 0 && !$("body").hasClass("fullscreen-card")) { - if (BoolVal(Grocy.UserSettings.auto_reload_on_db_change) && $("form.is-dirty").length === 0 && !$("body").hasClass("fullscreen-card")) - { - window.location.reload(); - } + window.location.reload(); } - - Grocy.DatabaseChangedTime = newDbChangedTime; } - }, - function(xhr) - { - console.error(xhr); + + Grocy.DatabaseChangedTime = newDbChangedTime; } - ); - }, 60000); -} + }, + function(xhr) + { + console.error(xhr); + } + ); +}, 60000); Grocy.IdleTime = 0; Grocy.ResetIdleTime = function() diff --git a/views/equipment.blade.php b/views/equipment.blade.php index 22c50dde..5ad96c06 100644 --- a/views/equipment.blade.php +++ b/views/equipment.blade.php @@ -3,7 +3,6 @@ @section('title', $__t('Equipment')) @section('activeNav', 'equipment') @section('viewJsName', 'equipment') -@section('DbChangedHandlingEnabledForPage', 'false') @section('content')