Introduce store helper
Responsible for serializing/deserializing data to be saved in localStorage. Add a prefix to all localStorage entries to avoid conflicts with other webapps. Stop guarding against localStorage not existing, browsers can just implement a dumb interface to disable it.
This commit is contained in:
parent
12a38ace90
commit
695b02caaa
4 changed files with 62 additions and 33 deletions
|
@ -74,17 +74,6 @@ export default class ConnectForm extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
var rememberMe = null;
|
||||
if (window.localStorage) {
|
||||
rememberMe = html`
|
||||
<label>
|
||||
<input type="checkbox" name="rememberMe" checked=${this.state.rememberMe} disabled=${this.props.disabled}/>
|
||||
Remember me
|
||||
</label>
|
||||
<br/><br/>
|
||||
`;
|
||||
}
|
||||
|
||||
return html`
|
||||
<form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
|
||||
<h2>Connect to IRC</h2>
|
||||
|
@ -101,7 +90,11 @@ export default class ConnectForm extends Component {
|
|||
</label>
|
||||
<br/><br/>
|
||||
|
||||
${rememberMe}
|
||||
<label>
|
||||
<input type="checkbox" name="rememberMe" checked=${this.state.rememberMe} disabled=${this.props.disabled}/>
|
||||
Remember me
|
||||
</label>
|
||||
<br/><br/>
|
||||
|
||||
<details>
|
||||
<summary>Advanced options</summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue