mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-03 07:45:21 +00:00
Break out of the while loop
Return will work, but is less correct and would break the flow of the function if code was ever added after it.
This commit is contained in:
parent
45daaa90c9
commit
8c018be61d
@ -1422,7 +1422,7 @@ return (function () {
|
||||
while(historyCache.length > 0){
|
||||
try {
|
||||
localStorage.setItem("htmx-history-cache", JSON.stringify(historyCache));
|
||||
return;
|
||||
break;
|
||||
} catch (e) {
|
||||
triggerErrorEvent(getDocument().body, "htmx:historyCacheError", {cause:e, cache: historyCache})
|
||||
historyCache.shift(); // shrink the cache and retry
|
||||
|
Loading…
x
Reference in New Issue
Block a user