fix: mas check in browser

This commit is contained in:
DIYgod 2025-02-10 16:15:43 +08:00
parent 82c3defbee
commit 0feb73557c
No known key found for this signature in database
3 changed files with 8 additions and 2 deletions

View File

@ -111,3 +111,7 @@ export const getBlockchainExplorerUrl = () => {
return `https://scan.rss3.io`
}
}
export const isInMAS = () => {
return typeof process !== "undefined" && process.mas
}

View File

@ -14,6 +14,7 @@ import { m } from "framer-motion"
import { useTranslation } from "react-i18next"
import { useCurrentModal } from "~/components/ui/modal/stacked/hooks"
import { isInMAS } from "~/lib/utils"
import { useAuthProviders } from "~/queries/users"
import { LoginWithPassword } from "./Form"
@ -45,7 +46,7 @@ export const LoginModalContent = (props: LoginModalContentProps) => {
</div>
<LoginWithPassword runtime={runtime} />
{!process.mas && (
{!isInMAS() && (
<>
<div className="my-3 w-full space-y-2">
<div className="flex items-center justify-center">

View File

@ -4,6 +4,7 @@ import { Label } from "@follow/components/ui/label/index.js"
import { signOut } from "@follow/shared/auth"
import { useModalStack } from "~/components/ui/modal/stacked/hooks"
import { isInMAS } from "~/lib/utils"
import { AccountManagement } from "~/modules/profile/account-management"
import { EmailManagement } from "~/modules/profile/email-management"
import { ProfileSettingForm } from "~/modules/profile/profile-setting-form"
@ -36,7 +37,7 @@ export function Component() {
<UpdatePasswordForm />
<TwoFactor />
{/* TODO: Temporary fake account deletion feature */}
{process.mas && (
{isInMAS() && (
<div className="flex items-center justify-between">
<Label>Delete Account</Label>
<Button