From f0c5fb835501f38ca31a54df1db6b448ca371fdb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 25 Mar 2022 20:52:51 +1100 Subject: [PATCH] Determine if plugins are enabled when connecting to the server --- lib/api.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/api.dart b/lib/api.dart index 45b2b119..44f7f636 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -227,6 +227,10 @@ class InvenTreeAPI { int get apiVersion => _apiVersion; + bool _pluginsEnabled = false; + + bool pluginsEnabled() => supportPlugins() && _pluginsEnabled; + // Getter for server version information String get version => _version; @@ -349,6 +353,8 @@ class InvenTreeAPI { return false; } + _pluginsEnabled = (data["plugins_enabled"] ?? false) as bool; + /** * Request user token information from the server * This is the stage that we check username:password credentials!