Merge pull request 'fix 'Maximum call stack size exceeded'' (#1951) from Dsm0/strudel:overflow_fix into main

Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1951
This commit is contained in:
froos 2026-02-05 10:26:30 +01:00
commit b4e171f5b4
2 changed files with 13 additions and 3 deletions

View file

@ -109,7 +109,12 @@ export function useReplContext() {
// Get the full buffer content from the editor instead of just the evaluated block
const fullBufferCode = editorRef.current?.code || code;
setLatestCode(fullBufferCode);
window.location.hash = '#' + code2hash(fullBufferCode);
try {
window.location.hash = '#' + code2hash(fullBufferCode);
} catch (e) {
console.warn('[useReplContext] Failed to update hash:', e.message);
}
setDocumentTitle(fullBufferCode);
const viewingPatternData = getViewingPatternData();
setVersionDefaultsFrom(fullBufferCode);