mirror of
https://github.com/inventree/inventree-app.git
synced 2025-07-12 08:34:16 +00:00
Save datetime since last reload
This commit is contained in:
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user