fix(cli): failed to sync route (#8498)

This commit is contained in:
neverland
2021-04-10 16:02:40 +08:00
committed by GitHub
parent 5fe263b601
commit 3ddfe3bbb4
2 changed files with 30 additions and 22 deletions
+1 -18
View File
@@ -1,20 +1,3 @@
function iframeReady(iframe, callback) {
const doc = iframe.contentDocument || iframe.contentWindow.document;
const interval = () => {
if (iframe.contentWindow.replacePath) {
callback();
} else {
setTimeout(interval, 50);
}
};
if (doc.readyState === 'complete') {
interval();
} else {
iframe.onload = interval;
}
}
const ua = navigator.userAgent.toLowerCase();
const isMobile = /ios|iphone|ipod|ipad|android/.test(ua);
@@ -25,4 +8,4 @@ export function decamelize(str, sep = '-') {
.toLowerCase();
}
export { isMobile, iframeReady };
export { isMobile };