2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 13:36:50 +00:00

Automatically add a demo server profile (#189)

This commit is contained in:
Oliver 2022-07-25 14:26:26 +10:00 committed by GitHub
parent 0165a4bad5
commit 75e0a69eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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; return profileList;
} }