This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
🐛 fix broken sidebar after successful import #658
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.
closes TryGhost/Ghost#8307
session.user
attribute after an import was triggering a rendering edge case where the style was re-computed and a re-render was attempted after the sidebar has been destroyedgh-nav-menu
we pass the menu icon in (usingsettings.settledIcon
- see below) and manually set the style attribute via thedidReceiveAttrs
hook so that outside changes don't trigger re-computations when we don't expect them and so we can still react to icons being uploaded or removedsettings.icon
is a bit of an odd situation because it's a link to an external resource that will only resolve correctly after a successful save - if we changesettings.icon
in the local store and the nav menu icon style updates before the save has been completed then the server will give us the old icon. To work around this asettings.settledIcon
attribute has been added that is only updated when we receive data from the store ensuring that our cache-busting technique works correctly