refactor: move IS_PLATFORM to config file for both frontend and backend

The reason we couldn't place it in shared/modelConstants.js is that the
frontend uses Vite which requires import.meta.env for environment variables,
while the backend uses process.env. Therefore, we created separate config files
for the frontend (src/constants/config.ts) and backend (server/constants/config.js).
This commit is contained in:
Haileyesus
2026-01-31 15:01:17 +03:00
parent 8bea3d83c8
commit b2fdb90203
10 changed files with 18 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
import React, { createContext, useContext, useEffect, useState } from 'react';
import { api } from '../utils/api';
import { IS_PLATFORM } from '../../shared/modelConstants';
import { IS_PLATFORM } from '../constants/config';
const AuthContext = createContext({
user: null,

View File

@@ -1,6 +1,6 @@
import { createContext, useContext, useEffect, useRef, useState } from 'react';
import { useAuth } from './AuthContext';
import { IS_PLATFORM } from '../../shared/modelConstants';
import { IS_PLATFORM } from '../constants/config';
type WebSocketContextType = {
ws: WebSocket | null;