Fixes #958: Disable auto-reload of equipments-page.

This commit is contained in:
fipwmaqzufheoxq92ebc 2020-10-11 12:12:40 +02:00
parent 5719ce8493
commit 41067b23bb
No known key found for this signature in database
GPG Key ID: F4DF989490C2ADB7
3 changed files with 24 additions and 19 deletions

View File

@ -15,6 +15,8 @@
// Check if the database has changed once a minute // 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, // 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 // when there is no unsaved form data and when the user enabled auto reloading
if(DbChangHandlingEnabled)
{
setInterval(function() setInterval(function()
{ {
Grocy.Api.Get('system/db-changed-time', Grocy.Api.Get('system/db-changed-time',
@ -40,6 +42,7 @@ setInterval(function()
} }
); );
}, 60000); }, 60000);
}
Grocy.IdleTime = 0; Grocy.IdleTime = 0;
Grocy.ResetIdleTime = function() Grocy.ResetIdleTime = function()

View File

@ -3,6 +3,7 @@
@section('title', $__t('Equipment')) @section('title', $__t('Equipment'))
@section('activeNav', 'equipment') @section('activeNav', 'equipment')
@section('viewJsName', 'equipment') @section('viewJsName', 'equipment')
@section('DbChangHandlingEnabled', 'false')
@section('content') @section('content')
<div class="row"> <div class="row">

View File

@ -82,7 +82,7 @@
@if(file_exists(GROCY_DATAPATH . '/custom_css.html')) @if(file_exists(GROCY_DATAPATH . '/custom_css.html'))
@php include GROCY_DATAPATH . '/custom_css.html' @endphp @php include GROCY_DATAPATH . '/custom_css.html' @endphp
@endif @endif
@section('DbChangHandlingEnabled', 'true')
<script> <script>
var Grocy = { }; var Grocy = { };
Grocy.Components = { }; Grocy.Components = { };
@ -105,6 +105,7 @@
Grocy.UserSettings = { }; Grocy.UserSettings = { };
Grocy.UserId = -1; Grocy.UserId = -1;
@endif @endif
const DbChangHandlingEnabled = @yield('DbChangHandlingEnabled');
</script> </script>
</head> </head>