Remove unused protocol register and open url code

This commit is contained in:
onevcat 2025-02-27 23:49:02 +09:00 committed by 亢奋猫
parent acc803aa43
commit cda4edfb7f

View File

@ -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')