fix: Cannot read properties of undefined (reading 'map') (close #148)

This commit is contained in:
CaIon
2024-03-25 14:10:57 +08:00
parent 8e491e6a29
commit 824cb8e26f
3 changed files with 18 additions and 0 deletions

View File

@@ -156,6 +156,9 @@ const SiderBar = () => {
const loadStatus = async () => {
const res = await API.get('/api/status');
if (res === undefined) {
return;
}
const { success, data } = res.data;
if (success) {
localStorage.setItem('status', JSON.stringify(data));