mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-20 04:18:19 -07:00
Remove nested Promise
This commit is contained in:
parent
eccaad366e
commit
748592fa93
@ -36,7 +36,6 @@ import 'css!components/viewManager/viewContainer';
|
|||||||
const newViewInfo = normalizeNewView(options, isPluginpage);
|
const newViewInfo = normalizeNewView(options, isPluginpage);
|
||||||
const newView = newViewInfo.elem;
|
const newView = newViewInfo.elem;
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
const currentPage = allPages[pageIndex];
|
const currentPage = allPages[pageIndex];
|
||||||
|
|
||||||
if (currentPage) {
|
if (currentPage) {
|
||||||
@ -82,8 +81,11 @@ import 'css!components/viewManager/viewContainer';
|
|||||||
}
|
}
|
||||||
|
|
||||||
allPages[pageIndex] = view;
|
allPages[pageIndex] = view;
|
||||||
|
|
||||||
|
return setControllerClass(view, options)
|
||||||
// Timeout for polyfilled CustomElements (webOS 1.2)
|
// Timeout for polyfilled CustomElements (webOS 1.2)
|
||||||
setControllerClass(view, options).then(() => new Promise((resolve) => setTimeout(resolve, 0))).then(() => {
|
.then(() => new Promise((resolve) => setTimeout(resolve, 0)))
|
||||||
|
.then(() => {
|
||||||
if (onBeforeChange) {
|
if (onBeforeChange) {
|
||||||
onBeforeChange(view, false, options);
|
onBeforeChange(view, false, options);
|
||||||
}
|
}
|
||||||
@ -101,8 +103,7 @@ import 'css!components/viewManager/viewContainer';
|
|||||||
$.mobile.activePage = view;
|
$.mobile.activePage = view;
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(view);
|
return view;
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user