mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-10-10 13:47:53 +00:00
fix: browser compatibility for shared api-client
- Add typeof check for process.env to avoid ReferenceError in browser - process.env only exists in Node.js, not browser environments - Fixes white screen issue when loading web frontend
This commit is contained in:
parent
d743982622
commit
568b69f93b
4 changed files with 26 additions and 2 deletions
|
|
@ -594,3 +594,4 @@
|
|||
{"type":"task.status_changed","taskId":"task_20260128_lePtYQ","project":"veritas-kanban","status":"done","previousStatus":"in-progress","id":"evt_3Iyqk4tXewur","timestamp":"2026-01-28T11:03:09.268Z"}
|
||||
{"type":"task.status_changed","taskId":"task_20260128_80Bww2","project":"veritas-kanban","status":"done","previousStatus":"in-progress","id":"evt_lhxfDcirN7Nm","timestamp":"2026-01-28T11:03:10.942Z"}
|
||||
{"type":"task.status_changed","taskId":"task_20260128_bIPwKK","project":"veritas-kanban","status":"done","previousStatus":"in-progress","id":"evt_qF5oHf8YG7Ha","timestamp":"2026-01-28T11:07:35.701Z"}
|
||||
{"type":"task.status_changed","taskId":"task_20260128_UMDZyh","project":"veritas-kanban","status":"done","previousStatus":"in-progress","id":"evt_DHjWHkRDV-eW","timestamp":"2026-01-28T12:09:08.261Z"}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,26 @@
|
|||
[
|
||||
{
|
||||
"id": "activity_1769602148289_c072zwzck",
|
||||
"type": "comment_added",
|
||||
"taskId": "task_20260128_UMDZyh",
|
||||
"taskTitle": "RF-11: Consolidate Frontend API Layer",
|
||||
"details": {
|
||||
"author": "Veritas",
|
||||
"preview": "Extended api.ts to cover all endpoints. Updated 6 ..."
|
||||
},
|
||||
"timestamp": "2026-01-28T12:09:08.289Z"
|
||||
},
|
||||
{
|
||||
"id": "activity_1769602148262_qy2on8vrt",
|
||||
"type": "status_changed",
|
||||
"taskId": "task_20260128_UMDZyh",
|
||||
"taskTitle": "RF-11: Consolidate Frontend API Layer",
|
||||
"details": {
|
||||
"from": "in-progress",
|
||||
"status": "done"
|
||||
},
|
||||
"timestamp": "2026-01-28T12:09:08.262Z"
|
||||
},
|
||||
{
|
||||
"id": "activity_1769598455726_9m6dfmawo",
|
||||
"type": "comment_added",
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@ export function createApiClient(baseUrl = DEFAULT_BASE) {
|
|||
|
||||
/**
|
||||
* Default API client using environment variable or localhost
|
||||
* Uses typeof check to avoid ReferenceError in browser environments
|
||||
*/
|
||||
export const API_BASE = process.env.VK_API_URL || DEFAULT_BASE;
|
||||
export const API_BASE = (typeof process !== 'undefined' && process.env?.VK_API_URL) || DEFAULT_BASE;
|
||||
export const api = createApiClient(API_BASE);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import './globals.css';
|
|||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 1000 * 60, // 1 minute
|
||||
staleTime: 1000 * 60,
|
||||
refetchOnWindowFocus: true,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue