@setoelkahfi / svara / commits / 69a2289

fix: improved file watcher performance

mellbacon committed Aug 23, 2023 at 14:34 UTC 69a22890ff2eecc62c91f64ee30b2a6b32263e3b
1 file changed +2 -2
src/lib/File.ts
+2 -2
@@ -2,7 +2,7 @@ import { dialog, fs, path, invoke, window } from "@tauri-apps/api";
2 import { get, writable } from 'svelte/store';
3 import { tabs, addEditorTab, renameTab, closeTab, refreshTabs } from "./EditorTabList.svelte";
4 import { filetree } from "./FileTree.svelte";
5 -import { watch } from "tauri-plugin-fs-watch-api";
5 +import { watchImmediate } from "tauri-plugin-fs-watch-api";
6 import { openFileTree } from "./Sidebar.svelte";
7
8 export async function openFile() {
@@ -30,7 +30,7 @@ export async function openFolder() {
30 return;
31 }
32 // load file watcher
33 - await watch(
33 + await watchImmediate(
34 directory,
35 () => {
36 updateTree(directory);