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:
parent
97b4eefc13
commit
349eca4533
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user