Skip to content

Commit b78ee14

Browse files
authored
Merge pull request #389 from webees/fix/cloud-login-external-browser
Fix cloud login opening in profile selector
2 parents 56c547d + d5f260b commit b78ee14

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/device-code-verify-dialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { invoke } from "@tauri-apps/api/core";
4+
import { openUrl } from "@tauri-apps/plugin-opener";
45
import { useEffect, useState } from "react";
56
import { useTranslation } from "react-i18next";
67
import { LuExternalLink } from "react-icons/lu";
@@ -45,7 +46,7 @@ export function DeviceCodeVerifyDialog({
4546
const handleOpenLogin = async () => {
4647
setIsOpeningLogin(true);
4748
try {
48-
await invoke("handle_url_open", { url: DEVICE_LINK_URL });
49+
await openUrl(DEVICE_LINK_URL);
4950
} catch (error) {
5051
console.error("Failed to open login link:", error);
5152
showErrorToast(String(error));

src/components/sync-config-dialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { invoke } from "@tauri-apps/api/core";
4+
import { openUrl } from "@tauri-apps/plugin-opener";
45
import { useCallback, useEffect, useState } from "react";
56
import { useTranslation } from "react-i18next";
67
import { LuEye, LuEyeOff } from "react-icons/lu";
@@ -206,7 +207,7 @@ export function SyncConfigDialog({
206207

207208
const handleOpenLogin = useCallback(async () => {
208209
try {
209-
await invoke("handle_url_open", { url: DEVICE_LINK_URL });
210+
await openUrl(DEVICE_LINK_URL);
210211
// Hand off the verify step to its own dialog so the user has a
211212
// focused place to paste the code, and so it doesn't visually
212213
// stack with this dialog or any other modal currently on screen.

0 commit comments

Comments
 (0)