Add button to stop page load - #282609
Conversation
…ditor.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| // No-op if we're in the cooldown period (prevents accidental double-click double reload) | ||
| if (inCooldownPeriod) { | ||
| return; |
There was a problem hiding this comment.
Can we just do this in the model? i.e. have it optimistically set itself to loading: true / false, and prevent sending the event from there. Then maybe we can remove the timeout too?
There was a problem hiding this comment.
The reason we need to keep the timeout is that I'm trying to achieve is an experience similar to Chrome and Edge, where there's a delay between clicking on the reload button and the time when the reload button turns into the Stop Loading button. We also don't want to mess with the loading state itself because we don't want this 500ms cooldown to apply to other aspects, such as showing the loading spinner.
I can however remove this no-op-enforcing code, since the most important part of the cooldown isn't to prevent double reloads, but rather to prevent accidental Stop Loading after a reload. I'll remove this now.
Please let me know if there's anything else you would suggest here.
… firing immediately after
Screen.Recording.2025-12-10.at.5.50.24.PM.mov
Added after the above video was recorded: