fix(chat): route private unlocks to subscription
This commit is contained in:
@@ -9,7 +9,7 @@ import type { LoginStatus } from "@/data/dto/auth";
|
||||
import { AppStorage } from "@/data/storage/app/app_storage";
|
||||
import { AuthStorage } from "@/data/storage/auth/auth_storage";
|
||||
import { UserStorage } from "@/data/storage/user/user_storage";
|
||||
import { useChatDispatch, useChatState } from "@/stores/chat/chat-context";
|
||||
import { useChatState } from "@/stores/chat/chat-context";
|
||||
import { AppEnvUtil, BrowserDetector, todayString, UrlLauncherUtil } from "@/utils";
|
||||
import { ROUTE_BUILDERS, ROUTES } from "@/router/routes";
|
||||
|
||||
@@ -36,7 +36,6 @@ function deriveIsGuest(loginStatus: LoginStatus): boolean {
|
||||
|
||||
export function ChatScreen() {
|
||||
const state = useChatState();
|
||||
const chatDispatch = useChatDispatch();
|
||||
const authState = useAuthState();
|
||||
const router = useRouter();
|
||||
const [showExternalBrowserDialog, setShowExternalBrowserDialog] =
|
||||
@@ -127,8 +126,13 @@ export function ChatScreen() {
|
||||
UrlLauncherUtil.openUrlWithExternalBrowser(ROUTES.splash);
|
||||
}
|
||||
|
||||
function handleUnlockPrivateMessage(messageId: string): void {
|
||||
chatDispatch({ type: "ChatUnlockPrivateMessage", messageId });
|
||||
function handleUnlockPrivateMessage(): void {
|
||||
const subscriptionUrl = ROUTE_BUILDERS.subscription("vip");
|
||||
if (isGuest) {
|
||||
router.push(ROUTE_BUILDERS.authWithRedirect(subscriptionUrl));
|
||||
return;
|
||||
}
|
||||
router.push(subscriptionUrl);
|
||||
}
|
||||
|
||||
function handleUnlockImagePaywall(): void {
|
||||
|
||||
Reference in New Issue
Block a user