Move reconnection delay mechanism into framework code #24566
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #24137, a delay was added before showing the reconnection dialog. At first this was implemented in JS, but I suggested moving the implementation into CSS so that we didn't have to worry about cases like "reconnection occurred during delay". This is great but has the drawback of complicating the
site.css
file in the project template.I've since realised that a third and better option exists, which is a hybrid: implementing the delay in CSS (via
transition
), but triggering it from JS. This retains the benefit of not risking inconsistency depending on the timing of reconnection, plus the benefit that it removes the extra code from the app developer's own CSS file.This PR makes that tweak, leaving the default delay at 500ms. Developers who want to override the delay can still easily do so using CSS. For example, to change it to 2 seconds: