Improvements (#1049)

* Fixes #1035: Check available amount after filtering by stock_entry_id

* Fixes #1036: Remove stock-related buttons/options from Shopping-list  if FEATURE_FLAG_STOCK is disabled

* Fixes #1010: Repair recipe-picture upload.

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

* Fix uncaught exception in locationpicker.js

* Fixes #761 and #762: Add "Remove exact amount" for products with tare weight handling and use it for recipe-consumption.

* Fixes #1048: Repair product-group-filter on "Master Data"/Products

* Renamed variable

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
fipwmaqzufheoxq92ebc
2020-10-14 17:48:37 +02:00
committed by GitHub
parent a66a4d0c22
commit a85998dd40
14 changed files with 125 additions and 84 deletions

View File

@@ -15,31 +15,34 @@
// 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
setInterval(function()
if (Grocy.DbChangedHandlingEnabledForPage)
{
Grocy.Api.Get('system/db-changed-time',
function(result)
{
var newDbChangedTime = moment(result.changed_time);
if (newDbChangedTime.isAfter(Grocy.DatabaseChangedTime))
setInterval(function()
{
Grocy.Api.Get('system/db-changed-time',
function(result)
{
if (Grocy.IdleTime >= 50)
var newDbChangedTime = moment(result.changed_time);
if (newDbChangedTime.isAfter(Grocy.DatabaseChangedTime))
{
if (BoolVal(Grocy.UserSettings.auto_reload_on_db_change) && $("form.is-dirty").length === 0 && !$("body").hasClass("fullscreen-card"))
if (Grocy.IdleTime >= 50)
{
window.location.reload();
if (BoolVal(Grocy.UserSettings.auto_reload_on_db_change) && $("form.is-dirty").length === 0 && !$("body").hasClass("fullscreen-card"))
{
window.location.reload();
}
}
}
Grocy.DatabaseChangedTime = newDbChangedTime;
Grocy.DatabaseChangedTime = newDbChangedTime;
}
},
function(xhr)
{
console.error(xhr);
}
},
function(xhr)
{
console.error(xhr);
}
);
}, 60000);
);
}, 60000);
}
Grocy.IdleTime = 0;
Grocy.ResetIdleTime = function()