Преглед на файлове

zen: fix chart loading

closes #5030
Frank преди 2 месеца
родител
ревизия
7a4aa68706
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      packages/console/app/src/routes/workspace/[id]/graph-section.tsx

+ 2 - 0
packages/console/app/src/routes/workspace/[id]/graph-section.tsx

@@ -221,6 +221,8 @@ export function GraphSection() {
   const isCurrentMonth = () => store.year === now.getFullYear() && store.month === now.getMonth()
   const isCurrentMonth = () => store.year === now.getFullYear() && store.month === now.getMonth()
 
 
   const chartConfig = createMemo((): ChartConfiguration | null => {
   const chartConfig = createMemo((): ChartConfiguration | null => {
+    if (typeof window === "undefined") return null
+
     const data = getData()
     const data = getData()
     const dates = getDates()
     const dates = getDates()
     if (!data?.usage?.length) return null
     if (!data?.usage?.length) return null