Merge pull request #6 from inventree/master
Some checks failed
Android / build (push) Has been cancelled
CI / test (push) Has been cancelled
iOS / build (push) Has been cancelled

update to version 22.7
This commit is contained in:
Hendrik Rauh 2026-03-29 16:08:47 +02:00 committed by GitHub
commit 84e8ccc43a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 257 additions and 48 deletions

View file

@ -411,7 +411,7 @@ class InvenTreeAPI {
* 5. Request information on available plugins
*/
Future<bool> _connectToServer() async {
if (!await _checkServer()) {
if (!await checkServer()) {
return false;
}
@ -451,8 +451,8 @@ class InvenTreeAPI {
* Check that the remote server is available.
* Ping the api/ endpoint, which does not require user authentication
*/
Future<bool> _checkServer() async {
String address = profile?.server ?? "";
Future<bool> checkServer({String? server}) async {
String address = server ?? profile?.server ?? "";
if (address.isEmpty) {
showSnackIcon(
@ -463,8 +463,10 @@ class InvenTreeAPI {
return false;
}
if (!address.endsWith("/")) {
address = address + "/";
String url = _makeUrl("/api/", base: address);
if (!url.endsWith("/")) {
url = url + "/";
}
// Cache the "strictHttps" setting, so we can use it later without async requirement
@ -474,7 +476,7 @@ class InvenTreeAPI {
debug("Connecting to ${apiUrl}");
APIResponse response = await get("", expectedStatusCode: 200);
APIResponse response = await get(url, expectedStatusCode: 200);
if (!response.successful()) {
debug("Server returned invalid response: ${response.statusCode}");