2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 10:45:29 +00:00

Refactor API connection code

This commit is contained in:
Oliver Walters
2021-02-09 14:16:31 +11:00
parent 1c0b469020
commit 7373805ea7
3 changed files with 177 additions and 141 deletions

View File

@ -180,7 +180,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
_reload();
// Attempt server login (this will load the newly selected profile
InvenTreeAPI().connect(context);
InvenTreeAPI().connectToServer(context);
}
void _deleteProfile(UserProfile profile) async {
@ -220,7 +220,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
List<Widget> children = [];
if (profiles.length > 0) {
if (profiles != null && profiles.length > 0) {
for (int idx = 0; idx < profiles.length; idx++) {
UserProfile profile = profiles[idx];