mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Save datetime since last reload
This commit is contained in:
parent
97b4eefc13
commit
349eca4533
1 changed files with 7 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue