mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
feat: implement onboarding preferences and welcome modal for new users (#7319)
* feat: implement onboarding preferences and welcome modal for new users * fixes * adding: defaultPreferences * fixes * fix: tests * fixes * fix: test * fix: test * fixes * fixes
This commit is contained in:
@@ -170,6 +170,27 @@ export const test = baseTest.extend<
|
||||
});
|
||||
await fs.promises.writeFile(path.join(userDataPath, file), content, 'utf-8');
|
||||
}
|
||||
} else {
|
||||
// No initUserDataPath provided: create default preferences to skip onboarding
|
||||
// BUT only if preferences.json doesn't already exist
|
||||
const prefsPath = path.join(userDataPath, 'preferences.json');
|
||||
const prefsExist = await existsAsync(prefsPath);
|
||||
|
||||
if (!prefsExist) {
|
||||
const defaultPreferences = {
|
||||
preferences: {
|
||||
onboarding: {
|
||||
hasLaunchedBefore: true,
|
||||
hasSeenWelcomeModal: true
|
||||
}
|
||||
}
|
||||
};
|
||||
await fs.promises.writeFile(
|
||||
prefsPath,
|
||||
JSON.stringify(defaultPreferences, null, 2),
|
||||
'utf-8'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const app = await playwright._electron.launch({
|
||||
|
||||
Reference in New Issue
Block a user