fix: guard systemConfigAtom reads against null

``logout`` calls ``clearAtomStorage(systemConfigAtom)`` which sets the
atom to ``null``, and on a fresh SPA login (no full reload)
``app.tsx``'s ``fetchSystemConfig`` doesn't re-run, so consumers that
read ``systemConfig.xxx`` directly crash with "Cannot read properties
of null". A hard refresh masks the bug. Add optional chaining at the
read sites (grafana url / dashboard uids, showMonitoring) so the
contract stays robust regardless of how the atom is reset.
This commit is contained in:
gitlawr
2026-05-18 15:36:29 +08:00
committed by jialin
parent d04604abe5
commit baf1508644
3 changed files with 5 additions and 5 deletions
@@ -127,7 +127,7 @@ const useModelsColumns = ({
return record.replicas > 0;
}
if (action.key === 'metrics') {
return systemConfig.showMonitoring;
return systemConfig?.showMonitoring;
}
return true;