Merge remote-tracking branch 'upstream/master'

* upstream/master:
  refresh the just edited style entry after history back
This commit is contained in:
dana 2018-08-30 00:57:00 -07:00
commit 06a3fafc6b

View File

@ -658,8 +658,15 @@ function switchUI({styleOnly} = {}) {
function onVisibilityChange() {
switch (document.visibilityState) {
// page restored without reloading via history navigation (currently only in FF)
// the catch here is that DOM may be outdated so we'll at least refresh the just edited style
// assuming other changes aren't important enough to justify making a complicated DOM sync
case 'visible':
highlightEditedStyle();
if (sessionStorage.justEditedStyleId) {
API.getStyles({id: sessionStorage.justEditedStyleId}).then(([style]) => {
handleUpdate(style, {method: 'styleUpdated'});
});
delete sessionStorage.justEditedStyleId;
}
break;
// going away
case 'hidden':