Skip to content

Commit

Permalink
Persist env in LocalStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
tekknolagi committed Nov 29, 2023
1 parent f231828 commit b2bd523
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scrapscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ def do_repl(self) -> None:
const input = document.getElementById("input");
const output = document.getElementById("output");
document.env = null;
document.env = window.localStorage.getItem('env');
input.addEventListener("keyup", async ({key}) => {
if (key === "Enter") {
const response = await sendRequest(document.env, input.value);
Expand All @@ -1021,6 +1021,7 @@ def do_repl(self) -> None:
output.innerHTML += result + "\n>>> ";
input.value = "";
document.env = env;
window.localStorage.setItem('env', env)
}
});
</script>
Expand Down

0 comments on commit b2bd523

Please sign in to comment.