feat(sidebar): show free chat allowance
This commit is contained in:
@@ -4,7 +4,6 @@ import { useEffect } from "react";
|
||||
|
||||
import { MobileShell } from "@/app/_components/core";
|
||||
import { useAppNavigator } from "@/router/use-app-navigator";
|
||||
import { useAuthState } from "@/stores/auth/auth-context";
|
||||
import { pwaUtil } from "@/utils";
|
||||
|
||||
import {
|
||||
@@ -15,8 +14,6 @@ import {
|
||||
} from "./components";
|
||||
import styles from "./components/splash-screen.module.css";
|
||||
|
||||
const AUTO_OPEN_CHAT_DELAY_MS = 1800;
|
||||
|
||||
// 尽量早地缓存 beforeinstallprompt,避免用户停留 splash 时浏览器事件已触发并丢失。
|
||||
if (typeof window !== "undefined") {
|
||||
pwaUtil.prepareInstallPrompt();
|
||||
@@ -24,7 +21,6 @@ if (typeof window !== "undefined") {
|
||||
|
||||
export function SplashScreen() {
|
||||
const navigator = useAppNavigator();
|
||||
const state = useAuthState();
|
||||
|
||||
const handleStartChat = () => {
|
||||
navigator.openChat({ replace: true });
|
||||
@@ -34,14 +30,6 @@ export function SplashScreen() {
|
||||
pwaUtil.prepareInstallPrompt();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const timer = window.setTimeout(() => {
|
||||
navigator.openChat({ replace: true });
|
||||
}, AUTO_OPEN_CHAT_DELAY_MS);
|
||||
|
||||
return () => window.clearTimeout(timer);
|
||||
}, [navigator]);
|
||||
|
||||
return (
|
||||
<MobileShell background="var(--color-sidebar-background)">
|
||||
<div className={styles.wrapper}>
|
||||
|
||||
Reference in New Issue
Block a user