fix: ignore file and editor protocols
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
import { is } from "@electron-toolkit/utils"
|
||||
import { APP_PROTOCOL } from "@follow/shared"
|
||||
import { callWindowExpose } from "@follow/shared/bridge"
|
||||
import type { BrowserWindowConstructorOptions } from "electron"
|
||||
import { app, BrowserWindow, screen, shell } from "electron"
|
||||
@@ -113,7 +114,9 @@ export function createWindow(
|
||||
|
||||
const handleExternalProtocol = async (e: Event, url: string, window: BrowserWindow) => {
|
||||
const { protocol } = new URL(url)
|
||||
if (protocol === "http:" || protocol === "https:" || protocol === "follow:") {
|
||||
|
||||
const ignoreProtocols = ["http", "https", APP_PROTOCOL, "file", "code", "cursor"]
|
||||
if (ignoreProtocols.includes(protocol.slice(0, -1))) {
|
||||
return
|
||||
}
|
||||
e.preventDefault()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useOnce } from "@follow/hooks"
|
||||
import { nextFrame } from "@follow/utils/dom"
|
||||
import { getStorageNS } from "@follow/utils/ns"
|
||||
import { repository } from "@pkg"
|
||||
import type { FC } from "react"
|
||||
@@ -72,18 +73,20 @@ const AppNotificationContainer: FC = () => {
|
||||
? {
|
||||
label: "What's new?",
|
||||
onClick: () => {
|
||||
present({
|
||||
clickOutsideToDismiss: true,
|
||||
title: "What's new?",
|
||||
autoFocus: false,
|
||||
modalClassName:
|
||||
"relative mx-auto mt-[10vh] scrollbar-none max-w-full overflow-auto px-2 lg:max-w-[65rem] lg:p-0",
|
||||
nextFrame(() => {
|
||||
present({
|
||||
clickOutsideToDismiss: true,
|
||||
title: "What's new?",
|
||||
autoFocus: false,
|
||||
modalClassName:
|
||||
"relative mx-auto mt-[10vh] scrollbar-none max-w-full overflow-auto px-2 lg:max-w-[65rem] lg:p-0",
|
||||
|
||||
CustomModalComponent: ({ children }) => {
|
||||
return <PeekModal>{children}</PeekModal>
|
||||
},
|
||||
content: Changelog,
|
||||
overlay: true,
|
||||
CustomModalComponent: ({ children }) => {
|
||||
return <PeekModal>{children}</PeekModal>
|
||||
},
|
||||
content: Changelog,
|
||||
overlay: true,
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user