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:
@@ -127,7 +127,7 @@ const useModelsColumns = ({
|
||||
return record.replicas > 0;
|
||||
}
|
||||
if (action.key === 'metrics') {
|
||||
return systemConfig.showMonitoring;
|
||||
return systemConfig?.showMonitoring;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user