main
raboid 6 years ago committed by Michael Fix
parent 4dea566193
commit 5f939ac3b4

@ -85,9 +85,7 @@ class Editor extends React.Component {
const storedThemes = getThemes(localStorage)
newState.themes = storedThemes
? [...storedThemes, ...this.state.themes]
: [...this.state.themes]
newState.themes = [...storedThemes, ...this.state.themes]
if (newState.theme) {
newState.theme = newState.themes.find(t => t.id === newState.theme) || DEFAULT_THEME
@ -107,7 +105,7 @@ class Editor extends React.Component {
newState.language = unescapeHtml(newState.language)
}
this.setState(newState)
this.updateState(newState)
this.isSafari =
window.navigator &&

@ -72,11 +72,6 @@ class Themes extends React.PureComponent {
}
}
selectHighlight = key => () =>
this.setState(({ selectedHighlight }) => ({
selectedHighlight: selectedHighlight === key ? null : key
}))
updateHighlights = updates =>
this.setState(({ highlights }) => ({
highlights: {
@ -94,11 +89,10 @@ class Themes extends React.PureComponent {
render() {
const { themes, theme, isVisible, toggleVisibility } = this.props
const { input } = this.state
const highlights = { ...theme.highlights, ...this.state.highlights }
const dropdownValue = isVisible ? { name: input } : { id: theme.id, name: theme.name }
const dropdownValue = isVisible ? { name: '' } : { id: theme.id, name: theme.name }
const dropdownList = [
{

Loading…
Cancel
Save