1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-22 15:05:48 +05:30

fix: linux registration paths on flatpak

This commit is contained in:
2026-02-23 21:34:59 +05:30
Verified
parent 750d20f344
commit 74171e52b0

View File

@@ -1,4 +1,4 @@
import { join, resourceDir, homeDir } from "@tauri-apps/api/path"; import { join, resourceDir, homeDir, configDir } from "@tauri-apps/api/path";
import * as fs from "@tauri-apps/plugin-fs"; import * as fs from "@tauri-apps/plugin-fs";
import { useKvPairs } from "@/helpers/use-kvpairs"; import { useKvPairs } from "@/helpers/use-kvpairs";
import { useSettingsPageStatesStore } from "@/services/store"; import { useSettingsPageStatesStore } from "@/services/store";
@@ -25,11 +25,12 @@ export function useLinuxRegisterer() {
const isFlatpak = await invoke<boolean>('is_flatpak'); const isFlatpak = await invoke<boolean>('is_flatpak');
const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir(); const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir();
const homeDirPath = await homeDir(); const homeDirPath = await homeDir();
const configDirPath = await configDir();
for (const file of filesToCopy) { for (const file of filesToCopy) {
const sourcePath = await join(resourceDirPath, file.source); const sourcePath = await join(resourceDirPath, file.source);
const destinationDir = await join(homeDirPath, file.dir); const destinationDir = isFlatpak ? await join(configDirPath, file.dir) : await join(homeDirPath, file.dir);
const destinationPath = await join(homeDirPath, file.destination); const destinationPath = isFlatpak ? await join(configDirPath, file.destination) : await join(homeDirPath, file.destination);
const dirExists = await fs.exists(destinationDir); const dirExists = await fs.exists(destinationDir);
if (dirExists) { if (dirExists) {