fix for undefined userId (#17117)

Co-authored-by: jo.wijnant <jo.wijnant@kontron.com>
This commit is contained in:
wijnanjo 2021-10-15 10:08:57 +02:00 committed by GitHub
parent 5253193708
commit c9c669d179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ function ChartList(props: ChartListProps) {
const [preparingExport, setPreparingExport] = useState<boolean>(false);
const { userId } = props.user;
const userKey = getFromLocalStorage(userId.toString(), null);
const userKey = getFromLocalStorage(userId?.toString(), null);
const openChartImportModal = () => {
showImportModal(true);

View File

@ -143,7 +143,7 @@ function DashboardList(props: DashboardListProps) {
};
const { userId } = props.user;
const userKey = getFromLocalStorage(userId.toString(), null);
const userKey = getFromLocalStorage(userId?.toString(), null);
const canCreate = hasPerm('can_write');
const canEdit = hasPerm('can_write');