Changes
This commit is contained in:
@@ -134,12 +134,17 @@ window.fetch = async function (input, init) {
|
||||
}
|
||||
};
|
||||
|
||||
// Check if we're in development mode
|
||||
const isDev = import.meta.env.DEV;
|
||||
|
||||
export default function ApiDevTools() {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [logs, setLogs] = useState<ApiLog[]>([...apiLogs]);
|
||||
const [selectedLog, setSelectedLog] = useState<ApiLog | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDev) return;
|
||||
|
||||
const update = () => setLogs([...apiLogs]);
|
||||
listeners.add(update);
|
||||
return () => {
|
||||
@@ -154,6 +159,11 @@ export default function ApiDevTools() {
|
||||
return "secondary";
|
||||
};
|
||||
|
||||
// Don't render in production
|
||||
if (!isDev) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!isOpen) {
|
||||
return (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user