Merge branch 'main' into feat/improve-perf

This commit is contained in:
2024-01-27 17:56:50 +07:00
23 changed files with 441 additions and 157 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", [

View File

@@ -373,3 +373,5 @@ export const QUOTES = [
"You can send secure messages on Nostr with https://0xchat.com/",
"Are you a fan of following topics, instead of people? Use https://zapddit.com",
];
export const VITE_FLATPAK_RESOURCE = import.meta.env.VITE_FLATPAK_RESOURCE;