2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-05-06 09:18:54 +00:00

Save datetime since last reload

This commit is contained in:
Oliver Walters 2022-05-09 20:51:27 +10:00
parent 97b4eefc13
commit 349eca4533

View File

@ -44,6 +44,9 @@ class InvenTreeModel {
// Construct an InvenTreeModel from a JSON data object
InvenTreeModel.fromJson(this.jsondata);
// Update whenever the model is loaded from the server
DateTime? lastReload;
// Override the endpoint URL for each subclass
String get URL => "";
@ -287,6 +290,8 @@ class InvenTreeModel {
}
lastReload = DateTime.now();
jsondata = response.asMap();
return true;
@ -357,6 +362,8 @@ class InvenTreeModel {
}
lastReload = DateTime.now();
return createFromJson(response.asMap());
}