This commit is contained in:
derv82 2017-12-07 01:33:35 -08:00
commit 465cdec625

View File

@ -459,7 +459,11 @@
if (sorting) { if (sorting) {
sorting = false; sorting = false;
docRootObserver.takeRecords(); docRootObserver.takeRecords();
start(); if (!restorationLimitExceeded()) {
start();
} else {
setTimeout(start, 1000);
}
} }
} }
function isMovable(el) { function isMovable(el) {
@ -474,9 +478,6 @@
} }
function moveAfter(el, expected) { function moveAfter(el, expected) {
if (!sorting) { if (!sorting) {
if (restorationLimitExceeded()) {
return false;
}
sorting = true; sorting = true;
docRootObserver.stop(); docRootObserver.stop();
} }
@ -493,11 +494,7 @@
restorationCounter = 0; restorationCounter = 0;
} }
lastRestorationTime = t; lastRestorationTime = t;
if (++restorationCounter > 100) { return ++restorationCounter > 2;
console.error('Stylus stopped restoring userstyle elements after 100 failed attempts.\n' +
'Please report on https://github.com/openstyles/stylus/issues');
return true;
}
} }
} }
})(); })();