2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Add framework for future self to check server compatibility

This commit is contained in:
Oliver Walters 2020-05-25 22:46:01 +10:00
parent c7f504fb44
commit aad616aea1

View File

@ -21,6 +21,14 @@ import 'package:shared_preferences/shared_preferences.dart';
class InvenTreeAPI {
// Minimum supported InvenTree server version is 0.1.1
static const List<int> MIN_SUPPORTED_VERSION = [0, 1, 1];
bool _checkServerVersion(String version) {
// TODO - Decode the provided version string and determine if the server is "new" enough
return false;
}
// Endpoint for requesting an API token
static const _URL_GET_TOKEN = "user/token/";
static const _URL_GET_VERSION = "";
@ -219,6 +227,10 @@ class InvenTreeAPI {
_version = data["version"];
if (!_checkServerVersion(_version)) {
// TODO - Something?
}
// Record the instance name of the server
instance = data['instance'] ?? '';