mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove nested Promise
This commit is contained in:
parent
eccaad366e
commit
748592fa93
1 changed files with 38 additions and 37 deletions
|
@ -36,7 +36,6 @@ import 'css!components/viewManager/viewContainer';
|
|||
const newViewInfo = normalizeNewView(options, isPluginpage);
|
||||
const newView = newViewInfo.elem;
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const currentPage = allPages[pageIndex];
|
||||
|
||||
if (currentPage) {
|
||||
|
@ -82,8 +81,11 @@ import 'css!components/viewManager/viewContainer';
|
|||
}
|
||||
|
||||
allPages[pageIndex] = view;
|
||||
|
||||
return setControllerClass(view, options)
|
||||
// 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) {
|
||||
onBeforeChange(view, false, options);
|
||||
}
|
||||
|
@ -101,8 +103,7 @@ import 'css!components/viewManager/viewContainer';
|
|||
$.mobile.activePage = view;
|
||||
}
|
||||
|
||||
resolve(view);
|
||||
});
|
||||
return view;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue