Do proper check that config is present

master
Håvar Aambø Fosstveit 2019-12-10 15:46:14 +01:00
parent 11cbeb04ac
commit f252c3ebd1
4 changed files with 11 additions and 11 deletions

View File

@ -29,7 +29,7 @@ const styles = (theme) =>
width : '100%', width : '100%',
height : '100%', height : '100%',
backgroundColor : 'var(--background-color)', backgroundColor : 'var(--background-color)',
backgroundImage : `url(${window.config.background})`, backgroundImage : `url(${window.config ? window.config.background : null})`,
backgroundAttachment : 'fixed', backgroundAttachment : 'fixed',
backgroundPosition : 'center', backgroundPosition : 'center',
backgroundSize : 'cover', backgroundSize : 'cover',
@ -118,9 +118,9 @@ const DialogTitle = withStyles(styles)((props) =>
return ( return (
<MuiDialogTitle disableTypography className={classes.dialogTitle} {...other}> <MuiDialogTitle disableTypography className={classes.dialogTitle} {...other}>
{ window.config.logo && <img alt='Logo' className={classes.logo} src={window.config.logo} /> } { window.config && window.config.logo && <img alt='Logo' className={classes.logo} src={window.config.logo} /> }
<Typography variant='h5'>{children}</Typography> <Typography variant='h5'>{children}</Typography>
{ window.config.loginEnabled && { window.config && window.config.loginEnabled &&
<Tooltip <Tooltip
onClose={handleTooltipClose} onClose={handleTooltipClose}
onOpen={handleTooltipOpen} onOpen={handleTooltipOpen}
@ -191,7 +191,7 @@ const ChooseRoom = ({
loggedIn ? roomClient.logout() : roomClient.login(); loggedIn ? roomClient.logout() : roomClient.login();
}} }}
> >
{ window.config.title } { window.config && window.config.title ? window.config.title : 'Multiparty meeting' }
<hr /> <hr />
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>

View File

@ -184,14 +184,14 @@ const TopBar = (props) =>
<MenuIcon /> <MenuIcon />
</IconButton> </IconButton>
</PulsingBadge> </PulsingBadge>
{ window.config.logo && <img alt='Logo' className={classes.logo} src={window.config.logo} /> } { window.config && window.config.logo && <img alt='Logo' className={classes.logo} src={window.config.logo} /> }
<Typography <Typography
className={classes.title} className={classes.title}
variant='h6' variant='h6'
color='inherit' color='inherit'
noWrap noWrap
> >
{ window.config.title } { window.config && window.config.title ? window.config.title : 'Multiparty meeting' }
</Typography> </Typography>
<div className={classes.grow} /> <div className={classes.grow} />
<div className={classes.actionButtons}> <div className={classes.actionButtons}>

View File

@ -28,7 +28,7 @@ const styles = (theme) =>
width : '100%', width : '100%',
height : '100%', height : '100%',
backgroundColor : 'var(--background-color)', backgroundColor : 'var(--background-color)',
backgroundImage : `url(${window.config.background})`, backgroundImage : `url(${window.config ? window.config.background : null})`,
backgroundAttachment : 'fixed', backgroundAttachment : 'fixed',
backgroundPosition : 'center', backgroundPosition : 'center',
backgroundSize : 'cover', backgroundSize : 'cover',
@ -117,9 +117,9 @@ const DialogTitle = withStyles(styles)((props) =>
return ( return (
<MuiDialogTitle disableTypography className={classes.dialogTitle} {...other}> <MuiDialogTitle disableTypography className={classes.dialogTitle} {...other}>
{ window.config.logo && <img alt='Logo' className={classes.logo} src={window.config.logo} /> } { window.config && window.config.logo && <img alt='Logo' className={classes.logo} src={window.config.logo} /> }
<Typography variant='h5'>{children}</Typography> <Typography variant='h5'>{children}</Typography>
{ window.config.loginEnabled && { window.config && window.config.loginEnabled &&
<Tooltip <Tooltip
onClose={handleTooltipClose} onClose={handleTooltipClose}
onOpen={handleTooltipOpen} onOpen={handleTooltipOpen}
@ -212,7 +212,7 @@ const JoinDialog = ({
loggedIn ? roomClient.logout() : roomClient.login(); loggedIn ? roomClient.logout() : roomClient.login();
}} }}
> >
{ window.config.title } { window.config && window.config.title ? window.config.title : 'Multiparty meeting' }
<hr /> <hr />
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>

View File

@ -34,7 +34,7 @@ const styles = (theme) =>
width : '100%', width : '100%',
height : '100%', height : '100%',
backgroundColor : 'var(--background-color)', backgroundColor : 'var(--background-color)',
backgroundImage : `url(${window.config.background})`, backgroundImage : `url(${window.config ? window.config.background : null})`,
backgroundAttachment : 'fixed', backgroundAttachment : 'fixed',
backgroundPosition : 'center', backgroundPosition : 'center',
backgroundSize : 'cover', backgroundSize : 'cover',