mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 11:25:49 +05:30
refactor: revert back to using rust side tauri opener
This commit is contained in:
@@ -15,8 +15,6 @@ import { invoke } from "@tauri-apps/api/core";
|
||||
import { SlidingButton } from "@/components/custom/slidingButton";
|
||||
import clsx from "clsx";
|
||||
import { NumberInput } from "@/components/custom/numberInput";
|
||||
import { openUrl } from "@tauri-apps/plugin-opener";
|
||||
import { useLogger } from "@/helpers/use-logger";
|
||||
|
||||
const websocketPortSchema = z.object({
|
||||
port: z.coerce.number<number>({
|
||||
@@ -33,21 +31,14 @@ const websocketPortSchema = z.object({
|
||||
});
|
||||
|
||||
function ExtInstallSettings() {
|
||||
const LOG = useLogger();
|
||||
const openLink = async (url: string, app: string | undefined) => {
|
||||
try {
|
||||
// await invoke('open_file_with_app', { filePath: url, appName: app }).then(() => {
|
||||
// toast.info("Opening link", {
|
||||
// description: `Opening link with ${app ? app : 'default app'}.`,
|
||||
// })
|
||||
// });
|
||||
await openUrl(url, app).then(() => {
|
||||
await invoke('open_file_with_app', { filePath: url, appName: app }).then(() => {
|
||||
toast.info("Opening link", {
|
||||
description: `Opening link with ${app ? app : 'default app'}.`,
|
||||
})
|
||||
});
|
||||
} catch (e) {
|
||||
LOG.error('NEODLP', `Failed to open link: ${e}`);
|
||||
console.error(e);
|
||||
toast.error("Failed to open link", {
|
||||
description: "An error occurred while trying to open the link.",
|
||||
|
||||
Reference in New Issue
Block a user