feat: supported flatpak version v3

This commit is contained in:
kogeletey
2024-01-25 14:49:53 +03:00
parent 4a99eb94e2
commit 43509fc943
20 changed files with 501 additions and 478 deletions

View File

@@ -14,6 +14,7 @@
"devDependencies": {
"@lume/tsconfig": "workspace:*",
"@lume/types": "workspace:*",
"@lume/utils": "workspace:^",
"@types/react": "^18.2.48",
"typescript": "^5.3.3"
}

View File

@@ -8,7 +8,8 @@ import {
NDKCacheUserProfile,
} from "@lume/types";
import { invoke } from "@tauri-apps/api/core";
import { appConfigDir, resolveResource } from "@tauri-apps/api/path";
import { resolve, appConfigDir, resolveResource } from "@tauri-apps/api/path";
import { VITE_FLATPAK_RESOURCE } from "@lume/utils";
import { Platform } from "@tauri-apps/plugin-os";
import { Child, Command } from "@tauri-apps/plugin-shell";
import Database from "@tauri-apps/plugin-sql";
@@ -92,7 +93,10 @@ export class LumeStorage {
}
public async launchDepot() {
const configPath = await resolveResource("resources/config.toml");
const configPath =
VITE_FLATPAK_RESOURCE !== null
? await resolve("/", VITE_FLATPAK_RESOURCE)
: await resolveResource("resources/config.toml");
const dataPath = await appConfigDir();
const command = Command.sidecar("bin/depot", [