mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-02-01 06:17:32 +00:00
refactor: Centralize platform mode detection using IS_PLATFORM constant; use token from Auth context in WebSocket connection
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React, { createContext, useContext, useEffect, useState } from 'react';
|
||||
import { api } from '../utils/api';
|
||||
import { IS_PLATFORM } from '../../shared/modelConstants';
|
||||
|
||||
const AuthContext = createContext({
|
||||
user: null,
|
||||
@@ -31,7 +32,7 @@ export const AuthProvider = ({ children }) => {
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (import.meta.env.VITE_IS_PLATFORM === 'true') {
|
||||
if (IS_PLATFORM) {
|
||||
setUser({ username: 'platform-user' });
|
||||
setNeedsSetup(false);
|
||||
checkOnboardingStatus();
|
||||
|
||||
Reference in New Issue
Block a user