修正分頁、Too many connection 問題
This commit is contained in:
@@ -148,9 +148,9 @@ export function CompetitionProvider({ children }: { children: ReactNode }) {
|
||||
console.log('ℹ️ 暫無競賽數據')
|
||||
}
|
||||
} else {
|
||||
console.error('❌ 競賽數據載入失敗:', competitionsData.message)
|
||||
// 設置空數組以避免undefined錯誤
|
||||
// 沒有競賽數據是正常情況,不報錯
|
||||
setCompetitions([])
|
||||
console.log('ℹ️ 暫無競賽數據')
|
||||
}
|
||||
|
||||
// 載入當前競賽
|
||||
@@ -173,7 +173,9 @@ export function CompetitionProvider({ children }: { children: ReactNode }) {
|
||||
console.log('ℹ️ 暫無當前競賽')
|
||||
}
|
||||
} else {
|
||||
console.error('❌ 當前競賽載入失敗:', currentData.message)
|
||||
// 沒有當前競賽是正常情況,不報錯
|
||||
setCurrentCompetition(null)
|
||||
console.log('ℹ️ 暫無當前競賽')
|
||||
}
|
||||
|
||||
// 載入評審數據
|
||||
@@ -191,8 +193,9 @@ export function CompetitionProvider({ children }: { children: ReactNode }) {
|
||||
console.log('ℹ️ 暫無評審數據')
|
||||
}
|
||||
} else {
|
||||
console.error('❌ 評審數據載入失敗:', judgesData.message)
|
||||
// 沒有評審數據是正常情況,不報錯
|
||||
setJudges([])
|
||||
console.log('ℹ️ 暫無評審數據')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('❌ 載入競賽數據失敗:', error)
|
||||
|
Reference in New Issue
Block a user