Don't fill history with garbage

This commit is contained in:
Recursing 2022-06-22 20:19:57 +02:00
parent 8c38991f5b
commit 24cc765027

View File

@ -23,7 +23,11 @@ function getHashData() {
function setHashData(data) { function setHashData(data) {
const text = JSON.stringify({ ...getHashData(), ...data }); const text = JSON.stringify({ ...getHashData(), ...data });
const compressed = deflate(text, { level: 9 }); const compressed = deflate(text, { level: 9 });
window.location.hash = encodeURIComponent(fromByteArray(compressed)); window.history.replaceState(
undefined,
"",
"#" + encodeURIComponent(fromByteArray(compressed))
);
} }
export default function PlaygroundPage() { export default function PlaygroundPage() {