swithc off console log in prod

This commit is contained in:
Ishaan Jaff 2024-07-30 13:02:55 -07:00
parent 50222d808b
commit c2289afee8
7 changed files with 21 additions and 0 deletions

View file

@ -91,6 +91,9 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
>>(null);
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
console.log = function() {};
}
const [baseUrl, setBaseUrl] = useState(
isLocal ? "http://localhost:4000" : ""
);

View file

@ -45,6 +45,9 @@ async function generateModelResponse(
) {
// base url should be the current base_url
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
console.log = function() {};
}
console.log("isLocal:", isLocal);
const proxyBaseUrl = isLocal
? "http://localhost:4000"

View file

@ -43,6 +43,9 @@ const Createuser: React.FC<CreateuserProps> = ({
useState<InvitationLink | null>(null);
const router = useRouter();
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
console.log = function() {};
}
const [baseUrl, setBaseUrl] = useState(
isLocal ? "http://localhost:4000" : ""
);

View file

@ -76,6 +76,9 @@ async function testFallbackModelResponse(
) {
// base url should be the current base_url
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
console.log = function() {};
}
console.log("isLocal:", isLocal);
const proxyBaseUrl = isLocal
? "http://localhost:4000"

View file

@ -43,6 +43,9 @@ const Navbar: React.FC<NavbarProps> = ({
// const userColors = require('./ui_colors.json') || {};
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
console.log = function() {};
}
const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;
const imageUrl = isLocal ? "http://localhost:4000/get_image" : "/get_image";
let logoutUrl = "";

View file

@ -5,6 +5,9 @@ import { message } from "antd";
const isLocal = process.env.NODE_ENV === "development";
const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;
if (isLocal === true) {
console.log = function() {};
}
export interface Model {
model_name: string;

View file

@ -17,6 +17,9 @@ import { useSearchParams, useRouter } from "next/navigation";
import { jwtDecode } from "jwt-decode";
import { Typography } from "antd";
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
console.log = function() {};
}
console.log("isLocal:", isLocal);
const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;