Skip to content

Commit

Permalink
FIx local vars in info modal and welcome
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBenc committed Nov 24, 2020
1 parent 949f71f commit 5bab6cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/frontend/components/common/infoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import actions from '../../actions'
import Modal from './modal'
import Alert from './alert'
import ImageModal from './imageModal'
import {localStorageVars} from '../../localStorage'

const Article = ({children, title, icon}) => (
<article className="article">
Expand All @@ -21,7 +22,7 @@ class InfoModal extends Component<Props, {dontShowAgainCheckbox: boolean; should
constructor(props) {
super(props)
this.state = {
dontShowAgainCheckbox: !(window.localStorage.getItem('dontShowInfoModal') === 'true'),
dontShowAgainCheckbox: window.localStorage.getItem(localStorageVars.INFO_MODAL) === 'true',
shouldShowImage: false,
}
this.checkboxClick = this.checkboxClick.bind(this)
Expand All @@ -34,7 +35,7 @@ class InfoModal extends Component<Props, {dontShowAgainCheckbox: boolean; should
}

closeInfoModal() {
this.props.closeInfoModal(this.state.dontShowAgainCheckbox) // TODO: true
this.props.closeInfoModal(this.state.dontShowAgainCheckbox)
}

toggleImage(shouldShowImage) {
Expand Down
3 changes: 2 additions & 1 deletion app/frontend/components/common/welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import actions from '../../actions'
import Modal from './modal'
import Alert from './alert'
import Branding from './branding'
import {localStorageVars} from '../../localStorage'

const Article = ({children, title, icon}) => (
<article className="article">
Expand Down Expand Up @@ -31,7 +32,7 @@ class Welcome extends Component<WelcomeProps, {dontShowAgainCheckbox: boolean}>
constructor(props) {
super(props)
this.state = {
dontShowAgainCheckbox: window.localStorage.getItem('dontShowDisclaimer') === 'true',
dontShowAgainCheckbox: window.localStorage.getItem(localStorageVars.WELCOME) === 'true',
}
this.checkboxClick = this.checkboxClick.bind(this)
this.closeWelcome = this.closeWelcome.bind(this)
Expand Down

0 comments on commit 5bab6cf

Please sign in to comment.