Skip to content

Commit

Permalink
fix(filebrowser): only set path if file can be opened
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenclaw900 committed Nov 28, 2021
1 parent 7261760 commit e901295
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/frontend/src/pages/FileBrowser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,21 @@
switch (contents.maintype) {
case "dir":
sendCmd(contents.path, "cd");
currentPath = contents.path;
break;
case "text":
sendCmd(contents.path, "open");
currentPath = contents.path;
break;
case "image":
sendCmd(contents.path, "img");
currentPath = contents.path;
break;
default:
alert(
"ERROR: can't view that type of file"
);
}
currentPath = contents.path;
}}
on:click={() => (selPath = contents)}
>
Expand Down

0 comments on commit e901295

Please sign in to comment.