-
Notifications
You must be signed in to change notification settings - Fork 451
Closed
Byron/open-rs
#116Labels
platform: windowsWindows specific issuesWindows specific issuesplugin: openerstatus: upstreamThis issue needs to be fixed in an upstream projectThis issue needs to be fixed in an upstream projecttype: bugSomething isn't workingSomething isn't workingtype: questionFurther information is requestedFurther information is requested
Description
Hi,
Windows + Tauri (latest) + Svelte 5
My code :
<script lang="ts">
import { FolderCog } from "@lucide/svelte";
import { appDataDir } from "@tauri-apps/api/path";
import { openPath } from "@tauri-apps/plugin-opener";
import { Button } from "$lib/components/ui/button/index.js";
const openUserFolder = async () => {
const appDataPath = await appDataDir();
try {
await openPath(
`${appDataPath}/myapp${import.meta.env.DEV ? ".dev" : ""}`
);
} catch (error) {
console.error("Error opening user folder:", error);
}
};
</script>
<Button
variant="outline"
size="icon"
class="cursor-pointer size-10"
onclick={openUserFolder}
title="Open User Folder"
>
<FolderCog />
</Button>The behavior is strange. At first, a window opens instantly to “Documents,” then 5 seconds later, the window to the user's folder opens correctly. How can this be fixed? Is it due to Svelte (reactivity)?
Metadata
Metadata
Assignees
Labels
platform: windowsWindows specific issuesWindows specific issuesplugin: openerstatus: upstreamThis issue needs to be fixed in an upstream projectThis issue needs to be fixed in an upstream projecttype: bugSomething isn't workingSomething isn't workingtype: questionFurther information is requestedFurther information is requested