Skip to content

Commit 74171e5

Browse files
committed
fix: linux registration paths on flatpak
1 parent 750d20f commit 74171e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/helpers/use-linux-registerer.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join, resourceDir, homeDir } from "@tauri-apps/api/path";
1+
import { join, resourceDir, homeDir, configDir } from "@tauri-apps/api/path";
22
import * as fs from "@tauri-apps/plugin-fs";
33
import { useKvPairs } from "@/helpers/use-kvpairs";
44
import { useSettingsPageStatesStore } from "@/services/store";
@@ -25,11 +25,12 @@ export function useLinuxRegisterer() {
2525
const isFlatpak = await invoke<boolean>('is_flatpak');
2626
const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir();
2727
const homeDirPath = await homeDir();
28+
const configDirPath = await configDir();
2829

2930
for (const file of filesToCopy) {
3031
const sourcePath = await join(resourceDirPath, file.source);
31-
const destinationDir = await join(homeDirPath, file.dir);
32-
const destinationPath = await join(homeDirPath, file.destination);
32+
const destinationDir = isFlatpak ? await join(configDirPath, file.dir) : await join(homeDirPath, file.dir);
33+
const destinationPath = isFlatpak ? await join(configDirPath, file.destination) : await join(homeDirPath, file.destination);
3334

3435
const dirExists = await fs.exists(destinationDir);
3536
if (dirExists) {

0 commit comments

Comments
 (0)