Skip to content

Commit 740aa14

Browse files
committed
fix: update initial sidebar favorites structure and versioning
1 parent 3107027 commit 740aa14

File tree

3 files changed

+11
-27
lines changed

3 files changed

+11
-27
lines changed

src-frontend/lib/initialization.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ export const initializationService = {
8585
const { setFavorites } = useSidebarStore.getState();
8686

8787
const favorites = [
88-
{ id: "dir-datasites", name: "Datasites", path: ["datasites"] },
88+
{
89+
id: "dir-datasites",
90+
name: "Datasites",
91+
path: ["datasites"],
92+
type: "folder",
93+
},
8994
];
9095

9196
// Wait for datasite email to be available
@@ -95,6 +100,7 @@ export const initializationService = {
95100
id: "dir-my-datasite",
96101
name: "My datasite",
97102
path: ["datasites", email],
103+
type: "folder",
98104
});
99105
}
100106

src-frontend/stores/useSidebarStore.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,7 @@ interface SidebarState {
2929
clearFavorites: () => void;
3030
}
3131

32-
const SIDEBAR_STORAGE_KEY = "syftui-sidebar";
33-
34-
// Migration function to handle old favorite format
35-
const migrateFavorites = (favorites: unknown[]): FavoriteItem[] => {
36-
return favorites.map((fav) => {
37-
const favorite = fav as Record<string, unknown>;
38-
// If the favorite doesn't have a type field, assume it's a folder (old format)
39-
if (!favorite.type) {
40-
return {
41-
id: favorite.id as string,
42-
name: favorite.name as string,
43-
path: favorite.path as string[],
44-
type: "folder" as const,
45-
};
46-
}
47-
return favorite as FavoriteItem;
48-
});
49-
};
32+
const SIDEBAR_STORAGE_KEY = "syftui-sidebar-20250628";
5033

5134
export const useSidebarStore = create<SidebarState>()(
5235
persist(
@@ -103,11 +86,6 @@ export const useSidebarStore = create<SidebarState>()(
10386
favorites: state.favorites,
10487
openSections: state.openSections,
10588
}),
106-
onRehydrateStorage: () => (state) => {
107-
if (state?.favorites) {
108-
state.favorites = migrateFavorites(state.favorites);
109-
}
110-
},
11189
},
11290
),
11391
);

src-tauri/src/version.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
pub const DESKTOP_VERSION: &str = "0.2.3";
2-
pub const DESKTOP_HASH: &str = "71aa4e2";
3-
pub const DESKTOP_BUILD: &str = "2025-06-26T19:51:00+00:00";
1+
pub const DESKTOP_VERSION: &str = "0.2.5";
2+
pub const DESKTOP_HASH: &str = "3107027";
3+
pub const DESKTOP_BUILD: &str = "2025-06-27T21:14:02+00:00";
44
pub const DAEMON_VERSION: &str = "0.6.0";
55
pub const DAEMON_HASH: &str = "06a5b88";
66
pub const DAEMON_BUILD: &str = "2025-06-26T09:59:00+05:30";

0 commit comments

Comments
 (0)