mirror of
https://github.com/inventree/inventree-app.git
synced 2025-05-07 09:48:56 +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
|
// Construct an InvenTreeModel from a JSON data object
|
||||||
InvenTreeModel.fromJson(this.jsondata);
|
InvenTreeModel.fromJson(this.jsondata);
|
||||||
|
|
||||||
|
// Update whenever the model is loaded from the server
|
||||||
|
DateTime? lastReload;
|
||||||
|
|
||||||
// Override the endpoint URL for each subclass
|
// Override the endpoint URL for each subclass
|
||||||
String get URL => "";
|
String get URL => "";
|
||||||
|
|
||||||
@ -287,6 +290,8 @@ class InvenTreeModel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastReload = DateTime.now();
|
||||||
|
|
||||||
jsondata = response.asMap();
|
jsondata = response.asMap();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -357,6 +362,8 @@ class InvenTreeModel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastReload = DateTime.now();
|
||||||
|
|
||||||
return createFromJson(response.asMap());
|
return createFromJson(response.asMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user