Skip to content

Commit

Permalink
fix: web url
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 2, 2024
1 parent dcd83bf commit 3bdde89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/renderer/src/lib/auth.ts
Original file line number Diff line number Diff line change
@@ -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,
})
}
}
5 changes: 3 additions & 2 deletions src/renderer/src/modules/feed-column/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 3bdde89

Please sign in to comment.