Fixed time copying.
/ docker_build (push) Successful in 1m9s
/ helm_deploy (push) Successful in 23s
Testing zangramru / lint (push) Successful in 30s
Testing zangramru / pytest (push) Successful in 18s

Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
This commit is contained in:
2026-07-02 18:52:51 +02:00
parent 042e8b8581
commit fcd7f6aaf9
+4 -5
View File
@@ -1030,8 +1030,6 @@
extraWords = data.extra || {}; extraWords = data.extra || {};
wordDefs = data.word_defs || {}; wordDefs = data.word_defs || {};
selected = []; selected = [];
const cb = board.flat().join('');
history.replaceState(null, '', '#' + cb);
startBoard(); renderFound(); updateStatus(); startBoard(); renderFound(); updateStatus();
startTimer(); startTimer();
} }
@@ -1062,11 +1060,11 @@
let text; let text;
if (puzzleNumber === null) { if (puzzleNumber === null) {
const compressedBoard = board.flat().join(''); const compressedBoard = board.flat().join('');
const url = window.location.origin + window.location.pathname + '#' + compressedBoard; const url = window.location.origin + window.location.pathname + '#' + encodeURIComponent(compressedBoard);
text = 'Занграммы!\n🎉 Мне потребовалось всего лишь ' + formatTime(displayElapsed()) + '\n\n' + url; text = 'Занграммы!\n🎉 Мне потребовалось всего лишь ' + formatTime(elapsed) + '\n\n' + url;
} else { } else {
text = 'Занграммы #' + puzzleNumber + text = 'Занграммы #' + puzzleNumber +
'\n🎉 Мне потребовалось всего лишь ' + formatTime(displayElapsed()) + '\n🎉 Мне потребовалось всего лишь ' + formatTime(elapsed) +
'\n\n' + window.location.href; '\n\n' + window.location.href;
} }
navigator.clipboard.writeText(text).then( navigator.clipboard.writeText(text).then(
@@ -1102,6 +1100,7 @@
sizeConfetti(); sizeConfetti();
const hash = decodeURIComponent(window.location.hash.slice(1) || ''); const hash = decodeURIComponent(window.location.hash.slice(1) || '');
if (hash && hash.length === 16) { if (hash && hash.length === 16) {
history.replaceState(null, '', window.location.pathname);
loadRandomPuzzle(hash); loadRandomPuzzle(hash);
} else { } else {
loadPuzzle(); loadPuzzle();