refactor(app): tighten chat and sync boundaries
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
* @file Automatically generated by barrelsby.
|
||||
*/
|
||||
|
||||
export * from "./chat-auth-sync";
|
||||
export * from "./chat-context";
|
||||
export * from "./chat-events";
|
||||
export * from "./chat-machine.actors";
|
||||
|
||||
@@ -6,5 +6,4 @@ export * from "./payment-context";
|
||||
export * from "./payment-events";
|
||||
export * from "./payment-machine";
|
||||
export * from "./payment-machine.actors";
|
||||
export * from "./payment-success-sync";
|
||||
export * from "./payment-state";
|
||||
|
||||
@@ -12,10 +12,9 @@ import { usePathname, useRouter } from "next/navigation";
|
||||
|
||||
import { AuthStorage } from "@/data/storage/auth";
|
||||
import { useAuthState } from "@/stores/auth/auth-context";
|
||||
import { useChatDispatch } from "@/stores/chat/chat-context";
|
||||
import { PROTECTED_ROUTES, ROUTES, type StaticRoute } from "@/router/routes";
|
||||
|
||||
import { useChatDispatch } from "./chat-context";
|
||||
|
||||
function isProtectedPath(pathname: string): boolean {
|
||||
return PROTECTED_ROUTES.some((route: StaticRoute) => pathname === route);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from "./chat-auth-sync";
|
||||
export * from "./payment-success-sync";
|
||||
export * from "./user-auth-sync";
|
||||
+1
-2
@@ -12,8 +12,7 @@ import { useEffect, useRef } from "react";
|
||||
import { useChatDispatch } from "@/stores/chat/chat-context";
|
||||
import { useUserDispatch } from "@/stores/user/user-context";
|
||||
import { hasPendingChatUnlock } from "@/lib/navigation/chat_unlock_session";
|
||||
|
||||
import { usePaymentState } from "./payment-context";
|
||||
import { usePaymentState } from "@/stores/payment/payment-context";
|
||||
|
||||
export function PaymentSuccessSync() {
|
||||
const paymentState = usePaymentState();
|
||||
@@ -12,8 +12,7 @@ import { useEffect, useRef } from "react";
|
||||
|
||||
import type { LoginStatus } from "@/data/dto/auth";
|
||||
import { useAuthState } from "@/stores/auth/auth-context";
|
||||
|
||||
import { useUserDispatch } from "./user-context";
|
||||
import { useUserDispatch } from "@/stores/user/user-context";
|
||||
|
||||
export function UserAuthSync() {
|
||||
const { hasInitialized, isLoading, loginStatus } = useAuthState();
|
||||
@@ -2,7 +2,6 @@
|
||||
* @file Automatically generated by barrelsby.
|
||||
*/
|
||||
|
||||
export * from "./user-auth-sync";
|
||||
export * from "./user-context";
|
||||
export * from "./user-events";
|
||||
export * from "./user-machine.actors";
|
||||
|
||||
Reference in New Issue
Block a user