File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 230
230
231
231
if (! cache ) {
232
232
file_path = await openDialog ();
233
+ if (! file_path ) throw new Error (' No file path selected.' );
233
234
await window .ipcRenderer .invoke (
234
235
' update-recent-directories' ,
235
236
file_path
255
256
}
256
257
257
258
const db_entries: Entry [] = await fetchEntries ();
259
+ console .log (' DB Entries:' , db_entries );
258
260
const entry_map = new Map <number , TagStackImageData >();
259
261
for (const entry of db_entries ) {
260
262
const filename = entry .filename ;
268
270
);
269
271
if (image ) {
270
272
entry_map .set (entry .id , image );
271
- } else {
273
+ } else if ( file_path === directory ) {
272
274
entry_map .set (entry .id , {
273
275
id: entry .id ,
274
276
url: ' ' ,
286
288
);
287
289
}
288
290
}
289
-
290
291
const ordered_image_data = db_entries
291
292
.map ((entry ) => entry_map .get (entry .id ))
292
293
.filter ((image ): image is TagStackImageData => !! image );
Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ function getMostRecentDirectory(): string {
125
125
'userData'
126
126
) } /db/recent_directories.json`;
127
127
128
+ if ( ! fs . existsSync ( `${ app . getPath ( 'userData' ) } /db` ) )
129
+ fs . mkdirSync ( `${ app . getPath ( 'userData' ) } /db` ) ;
128
130
if ( ! fs . existsSync ( recent_directories_path ) )
129
131
fs . writeFileSync ( recent_directories_path , '[]' ) ;
130
132
You can’t perform that action at this time.
0 commit comments