@@ -1,15 +1,16 @@
|
||||
import { signIn } from "@hono/auth-js/react"
|
||||
import { WEB_URL } from "@shared/constants"
|
||||
|
||||
export const LOGIN_CALLBACK_URL = `${import.meta.env.VITE_WEB_URL}/redirect?app=follow`
|
||||
export const LOGIN_CALLBACK_URL = `${WEB_URL}/redirect?app=follow`
|
||||
export type LoginRuntime = "browser" | "app"
|
||||
export const loginHandler = (provider: string, runtime: LoginRuntime = "app") => {
|
||||
if (window.electron) {
|
||||
window.open(
|
||||
`${import.meta.env.VITE_WEB_URL}/login?provider=${provider}`,
|
||||
`${WEB_URL}/login?provider=${provider}`,
|
||||
)
|
||||
} else {
|
||||
signIn(provider, {
|
||||
callbackUrl: runtime === "app" ? LOGIN_CALLBACK_URL : import.meta.env.VITE_WEB_URL,
|
||||
callbackUrl: runtime === "app" ? LOGIN_CALLBACK_URL : WEB_URL,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import { showNativeMenu } from "@renderer/lib/native-menu"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import type { SubscriptionPlainModel } from "@renderer/store"
|
||||
import { getFeedById, useFeedById, useUnreadStore } from "@renderer/store"
|
||||
import { WEB_URL } from "@shared/constants"
|
||||
import { memo, useCallback } from "react"
|
||||
|
||||
import { useFeedClaimModal } from "../claim/hooks"
|
||||
@@ -87,7 +88,7 @@ const FeedItemImpl = ({
|
||||
onClick={handleNavigate}
|
||||
onDoubleClick={() => {
|
||||
window.open(
|
||||
`${import.meta.env.VITE_WEB_URL}/feed/${
|
||||
`${WEB_URL}/feed/${
|
||||
subscription.feedId
|
||||
}?view=${view}`,
|
||||
"_blank",
|
||||
@@ -142,7 +143,7 @@ const FeedItemImpl = ({
|
||||
label: "Open Feed in Browser",
|
||||
click: () =>
|
||||
window.open(
|
||||
`${import.meta.env.VITE_WEB_URL}/feed/${
|
||||
`${WEB_URL}/feed/${
|
||||
subscription.feedId
|
||||
}?view=${view}`,
|
||||
"_blank",
|
||||
|
||||
Reference in New Issue
Block a user