mirror of
https://github.com/ad044/lainTSX.git
synced 2024-10-22 23:19:06 +00:00
Save state -> Load state
This commit is contained in:
parent
5655e31bfd
commit
2c32826c64
1 changed files with 4 additions and 4 deletions
|
@ -8,7 +8,7 @@ const Savefile = () => {
|
||||||
setTextAreaValue(localStorage.getItem("lainSaveState") || "");
|
setTextAreaValue(localStorage.getItem("lainSaveState") || "");
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const saveState = useCallback(() => {
|
const loadState = useCallback(() => {
|
||||||
if (textAreaValue) localStorage.setItem("lainSaveState", textAreaValue);
|
if (textAreaValue) localStorage.setItem("lainSaveState", textAreaValue);
|
||||||
else localStorage.setItem("lainSaveState", "");
|
else localStorage.setItem("lainSaveState", "");
|
||||||
}, [textAreaValue]);
|
}, [textAreaValue]);
|
||||||
|
@ -25,11 +25,11 @@ const Savefile = () => {
|
||||||
the box below is your "save file". To export it for future use, just
|
the box below is your "save file". To export it for future use, just
|
||||||
copy everything inside it and paste it inside a file somewhere
|
copy everything inside it and paste it inside a file somewhere
|
||||||
locally. To re-import it later, take the contents of the file, paste
|
locally. To re-import it later, take the contents of the file, paste
|
||||||
them here, and press "Save state". After that, reload the website.
|
them here, and press "Load state". After that, reload the website.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
If you're here simply to reset your progress, just delete everything
|
If you're here simply to reset your progress, just delete everything
|
||||||
inside the textbox below and press "Save state".
|
inside the textbox below and press "Load state".
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Keep in mind, manually modifying the contents without being
|
Keep in mind, manually modifying the contents without being
|
||||||
|
@ -38,7 +38,7 @@ const Savefile = () => {
|
||||||
</p>
|
</p>
|
||||||
<textarea value={textAreaValue} onChange={handleTextValueChange} />
|
<textarea value={textAreaValue} onChange={handleTextValueChange} />
|
||||||
<br />
|
<br />
|
||||||
<button onClick={saveState}>Save state</button>
|
<button onClick={loadState}>Load State</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue