71ea4e74f6
* Merge branch 'vnext' of https://github.com/mozilla/send into android-preferences Fix conflicts * Implement wss preference url in html; Update to work with the tip of vnext branch; allow viewing the android ui from the webpack server * Use a try/catch in case localStorage isn't available, which it isn't in a ServiceWorker
36 lines
768 B
JavaScript
36 lines
768 B
JavaScript
const html = require('choo/html');
|
|
|
|
import { setFileProtocolWssUrl, getFileProtocolWssUrl } from '../../app/api';
|
|
|
|
export default function preferences(state, emit) {
|
|
const wssURL = getFileProtocolWssUrl();
|
|
|
|
function updateWssUrl(event) {
|
|
state.wssURL = event.target.value;
|
|
setFileProtocolWssUrl(state.wssURL);
|
|
emit('render');
|
|
}
|
|
|
|
function clickDone(event) {
|
|
event.preventDefault();
|
|
emit('pushState', '/');
|
|
}
|
|
|
|
return html`<body>
|
|
<div id="white">
|
|
<div id="preferences">
|
|
<a onclick=${clickDone} href="#">
|
|
done
|
|
</a>
|
|
<dl>
|
|
<dt>
|
|
wss url:
|
|
</dt>
|
|
<dd>
|
|
<input type="text" onchange=${updateWssUrl} value=${wssURL} />
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
</body>`;
|
|
}
|