Skip to content

Commit 158172d

Browse files
committed
feat: add quick app short cuts
1 parent 6895d11 commit 158172d

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

uncode-ui/src/uncode-bridge.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { open } from '@tauri-apps/api/dialog';
22
import { invoke } from '@tauri-apps/api/tauri';
33
import { emit, listen } from '@tauri-apps/api/event';
4+
import { exit } from '@tauri-apps/api/app';
45

56
const UncodeBridge = {
67
// todo: move listen to here
@@ -23,6 +24,10 @@ const UncodeBridge = {
2324
},
2425
},
2526

27+
exit() {
28+
exit();
29+
},
30+
2631
get_story(): Promise<any> {
2732
return invoke('get_story', {
2833
root: this.config.uncode.path,

uncode-ui/src/uncode-shortcuts.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const UncodeShortcuts = {
1515
UncodeBridge.open_dialog();
1616
return false;
1717
});
18+
hotkeys('ctrl+q, command+q', function () {
19+
UncodeBridge.exit();
20+
return false;
21+
});
1822
},
1923
bind_history(history: any) {
2024
let histories = [

uncode/uncode-core/src/file_entry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ impl FileEntry {
107107

108108
fn level_one_with_root(child: &Path, root_dir: &Path) -> FileEntry {
109109
let mut root = FileEntry::new(child, root_dir);
110+
root.is_dir = true;
110111

111112
let _result = FileEntry::by_depth_one(child, &mut root, root_dir);
112113
root.children.sort_by_key(|a| {

0 commit comments

Comments
 (0)