feat(#1): Add state to localstorage

This commit is contained in:
Josh Creek
2022-10-08 17:17:41 +01:00
parent 75425e954e
commit eff426550b
+9
View File
@@ -228,6 +228,15 @@ function startSpinning() {
const button = document.getElementById('startSpinning');
button.onclick = startSpinning;
const textArea = <HTMLInputElement>document.getElementById('input-lines');
if (window.localStorage.TextEditorData) {
textArea.value = window.localStorage.TextEditorData;
}
textArea.addEventListener('keyup', () => {
window.localStorage.TextEditorData = textArea.value;
});
if (process.env.NODE_ENV === 'production') {
loadServiceWorker();
}