From eff426550b471a558b04730d9ea0cdc7c183be9f Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Sat, 8 Oct 2022 17:17:41 +0100 Subject: [PATCH 1/2] feat(#1): Add state to localstorage --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 84b19ad..f8b7015 100644 --- a/src/index.ts +++ b/src/index.ts @@ -228,6 +228,15 @@ function startSpinning() { const button = document.getElementById('startSpinning'); button.onclick = startSpinning; +const textArea = 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(); } From 39d4ded1fb26f6c2bcb2f4ec1b3e37c8f62c9afa Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Sat, 8 Oct 2022 17:19:00 +0100 Subject: [PATCH 2/2] chore(#1): Update version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4957afe..cde347d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "SelectionWheel", - "version": "1.2.0", + "version": "1.3.0", "description": "A fun and simple selection wheel.", "main": "index.js", "scripts": {