mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Automatically add a demo server profile (#189)
This commit is contained in:
parent
0165a4bad5
commit
75e0a69eab
1 changed files with 22 additions and 0 deletions
|
|
@ -190,6 +190,28 @@ class UserProfileDBManager {
|
|||
}
|
||||
}
|
||||
|
||||
// If there are no available profiles, create a demo profile
|
||||
if (profileList.isEmpty) {
|
||||
bool added = await InvenTreeSettingsManager().getBool("demo_profile_added", false);
|
||||
|
||||
// Don't add a new profile if we have added it previously
|
||||
if (!added) {
|
||||
|
||||
await InvenTreeSettingsManager().setValue("demo_profile_added", true);
|
||||
|
||||
UserProfile demoProfile = UserProfile(
|
||||
name: "InvenTree Demo",
|
||||
server: "https://demo.inventree.org",
|
||||
username: "allaccess",
|
||||
password: "nolimits",
|
||||
);
|
||||
|
||||
await addProfile(demoProfile);
|
||||
|
||||
profileList.add(demoProfile);
|
||||
}
|
||||
}
|
||||
|
||||
return profileList;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue