From cda4edfb7f5820c2bed0d0ca66c0374948f6743e Mon Sep 17 00:00:00 2001 From: onevcat Date: Thu, 27 Feb 2025 23:49:02 +0900 Subject: [PATCH] Remove unused protocol register and open url code --- src/main/index.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index c3c9553a..d563e19e 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -20,25 +20,6 @@ if (!app.requestSingleInstanceLock()) { app.whenReady().then(async () => { await updateUserDataPath() - // Register custom protocol - if (!app.isDefaultProtocolClient('cherrystudio')) { - app.setAsDefaultProtocolClient('cherrystudio') - } - - // Handle protocol open - app.on('open-url', (event, url) => { - event.preventDefault() - const parsedUrl = new URL(url) - if (parsedUrl.pathname === 'siliconflow.oauth.login') { - const code = parsedUrl.searchParams.get('code') - if (code) { - // Handle the OAuth code here - console.log('OAuth code received:', code) - // You can send this code to your renderer process via IPC if needed - } - } - }) - // Set app user model id for windows electronApp.setAppUserModelId(import.meta.env.VITE_MAIN_BUNDLE_ID || 'com.kangfenmao.CherryStudio')