mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Refactor API connection code
This commit is contained in:
parent
1c0b469020
commit
7373805ea7
3 changed files with 177 additions and 141 deletions
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue