Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
ux(CreateWebsite): Set recent website
Browse files Browse the repository at this point in the history
  • Loading branch information
iakdis committed Mar 26, 2023
1 parent c2e722f commit c321369
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/src/pages/create_website.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,24 @@ class _CreateWebsiteState extends State<CreateWebsite> {
Preferences.clearPreferencesSite();
Preferences.setOnBoardingComplete(true);

Preferences.setSitePath(
'$sitePath${Platform.pathSeparator}$siteName');
final finalSitePath =
'$sitePath${Platform.pathSeparator}$siteName';

Preferences.setSitePath(finalSitePath);
Preferences.setCurrentPath(
'${Preferences.getSitePath()}${Platform.pathSeparator}content');

final recentPaths = Preferences.getRecentSitePaths();
if (recentPaths.contains(sitePath)) {
for (var i = 0; i < recentPaths.length; i++) {
if (recentPaths[i] == sitePath) {
recentPaths.removeAt(i);
}
}
}
Preferences.setRecentSitePaths(
recentPaths..insert(0, finalSitePath));

Preferences.setSSG(ssg.name);

shellProvider.updateShell();
Expand Down

0 comments on commit c321369

Please sign in to comment.