pull/504/head
FabianLars 2 years ago
parent 31f3385065
commit 7f1a9bbf87
No known key found for this signature in database
GPG Key ID: 838F329885A9C43D

@ -5,4 +5,5 @@ dist-js
pnpm-lock.yaml
Cargo.lock
.build
build
api-iife.js

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

@ -19,7 +19,7 @@ http
function (_error, content) {
response.writeHead(200);
response.end(content, "utf-8");
}
},
);
} else {
response.writeHead(404);

@ -2,7 +2,10 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { onOpenUrl, getCurrent as getCurrentDeepLinkUrls } from "@tauri-apps/plugin-deep-link";
import {
onOpenUrl,
getCurrent as getCurrentDeepLinkUrls,
} from "@tauri-apps/plugin-deep-link";
function handler(urls: string[]) {
console.log(urls);

@ -6,16 +6,20 @@ import { invoke } from "@tauri-apps/api/tauri";
import { UnlistenFn, listen } from "@tauri-apps/api/event";
export async function getCurrent(): Promise<string[] | null> {
return await invoke<string[] | null>("plugin:deep-link|get_current")
return await invoke<string[] | null>("plugin:deep-link|get_current");
// return await invoke("plugin:deep-link|get_current");
}
export async function onOpenUrl(handler: (urls: string[]) => void): Promise<UnlistenFn> {
const current = await getCurrent()
export async function onOpenUrl(
handler: (urls: string[]) => void,
): Promise<UnlistenFn> {
const current = await getCurrent();
if (current != null) {
handler(current)
handler(current);
}
return await listen<string[]>("deep-link://new-url", (event) => handler(event.payload))
return await listen<string[]>("deep-link://new-url", (event) =>
handler(event.payload),
);
}

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8")
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});

@ -1,2 +1,6 @@
export const prerender = true
export const ssr = false
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
export const prerender = true;
export const ssr = false;

@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import adapter from '@sveltejs/adapter-static'
import adapter from "@sveltejs/adapter-static";
import { vitePreprocess } from "@sveltejs/kit/vite";
/** @type {import('@sveltejs/kit').Config} */

Loading…
Cancel
Save