fix(api): handle null return type for localStorage getItem

This commit is contained in:
2026-04-15 05:04:11 +00:00
parent 1a20a1050b
commit 95972b329e
2 changed files with 3 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ const WIZARD_PORT = Number(import.meta.env.VITE_WIZARD_PORT) || 18080
const WIZARD_BASE = `http://127.0.0.1:${WIZARD_PORT}`
const getApiBase = () => {
return localStorage.getItem('HF_BACKEND_BASE_URL')
return localStorage.getItem('HF_BACKEND_BASE_URL') ?? undefined
}
type AppState = 'checking' | 'setup' | 'ready'

View File

@@ -1,7 +1,7 @@
import axios from 'axios'
const getApiBase = () => {
return localStorage.getItem('HF_BACKEND_BASE_URL')
const getApiBase = (): string | undefined => {
return localStorage.getItem('HF_BACKEND_BASE_URL') ?? undefined
}
const api = axios.create({