mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 11:37:47 +01:00
refactor: only call oauth in settings window (#972)
This commit is contained in:
@@ -10,7 +10,7 @@ import { useAppStore } from "@/stores/appStore";
|
||||
import { useConnectStore } from "@/stores/connectStore";
|
||||
import platformAdapter from "@/utils/platformAdapter";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { MAIN_WINDOW_LABEL } from "@/constants";
|
||||
import { MAIN_WINDOW_LABEL, SETTINGS_WINDOW_LABEL } from "@/constants";
|
||||
import { useAsyncEffect, useEventListener } from "ahooks";
|
||||
|
||||
export interface DeepLinkHandler {
|
||||
@@ -86,7 +86,13 @@ export function useDeepLinkManager() {
|
||||
const handlers: DeepLinkHandler[] = [
|
||||
{
|
||||
pattern: "oauth_callback",
|
||||
handler: handleOAuthCallback,
|
||||
handler: async (url) => {
|
||||
const windowLabel = await platformAdapter.getCurrentWindowLabel();
|
||||
|
||||
if (windowLabel !== SETTINGS_WINDOW_LABEL) return;
|
||||
|
||||
handleOAuthCallback(url);
|
||||
},
|
||||
},
|
||||
{
|
||||
pattern: "install_extension_from_store",
|
||||
|
||||
Reference in New Issue
Block a user