turning data recipes on for mac (#4454)
This commit is contained in:
parent
e6a42d0073
commit
e793c378db
2 changed files with 9 additions and 3 deletions
|
|
@ -15,10 +15,16 @@ import { AppProvider } from "../provider";
|
|||
|
||||
const CHAT_ONLY_ALLOWED = new Set(["/", "/chat", "/login", "/signup", "/change-password"]);
|
||||
|
||||
function isChatOnlyAllowed(pathname: string): boolean {
|
||||
if (CHAT_ONLY_ALLOWED.has(pathname)) return true;
|
||||
if (pathname === "/data-recipes" || pathname.startsWith("/data-recipes/")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
export const Route = createRootRoute({
|
||||
beforeLoad: ({ location }) => {
|
||||
const chatOnly = usePlatformStore.getState().isChatOnly();
|
||||
if (chatOnly && !CHAT_ONLY_ALLOWED.has(location.pathname)) {
|
||||
if (chatOnly && !isChatOnlyAllowed(location.pathname)) {
|
||||
throw redirect({ to: "/chat" });
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ export function Navbar() {
|
|||
const disabledByTraining =
|
||||
isTrainingRunning && item.href !== "/studio";
|
||||
const disabledByDevice =
|
||||
chatOnly && item.href !== "/chat";
|
||||
chatOnly && item.href !== "/chat" && item.href !== "/data-recipes";
|
||||
if (!item.enabled || disabledByTraining || disabledByDevice) {
|
||||
return (
|
||||
<span
|
||||
|
|
@ -240,7 +240,7 @@ export function Navbar() {
|
|||
const disabledByTraining =
|
||||
isTrainingRunning && item.href !== "/studio";
|
||||
const disabledByDevice =
|
||||
chatOnly && item.href !== "/chat";
|
||||
chatOnly && item.href !== "/chat" && item.href !== "/data-recipes";
|
||||
if (disabledByTraining || disabledByDevice) {
|
||||
return (
|
||||
<span
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue