fix url scheme

This commit is contained in:
pompurin404 2024-08-29 18:10:15 +08:00
parent d2d4976b86
commit 0c566bdeb5
No known key found for this signature in database
3 changed files with 11 additions and 0 deletions

View File

@ -130,6 +130,7 @@ async function handleDeepLink(url: string): Promise<void> {
name: profileName ?? undefined,
url: profileUrl
})
mainWindow?.webContents.send('profileConfigUpdated')
new Notification({ title: '订阅导入成功' }).show()
break
} catch (e) {

View File

@ -76,6 +76,15 @@ export const ProfileConfigProvider: React.FC<{ children: ReactNode }> = ({ child
}
}
React.useEffect(() => {
window.electron.ipcRenderer.on('profileConfigUpdated', () => {
mutateProfileConfig()
})
return (): void => {
window.electron.ipcRenderer.removeAllListeners('profileConfigUpdated')
}
}, [])
return (
<ProfileConfigContext.Provider
value={{

View File

@ -36,6 +36,7 @@ const Profiles: React.FC = () => {
const handleImport = async (): Promise<void> => {
setImporting(true)
await addProfileItem({ name: '', type: 'remote', url, useProxy })
setUrl('')
setImporting(false)
}
const pageRef = useRef<HTMLDivElement>(null)