mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Update src/components/appRouter.js
Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>
This commit is contained in:
parent
2015665a64
commit
138e8460f6
@ -314,17 +314,18 @@ class AppRouter {
|
|||||||
url += '?' + ctx.querystring;
|
url += '?' + ctx.querystring;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let promise;
|
||||||
if (route.serverRequest) {
|
if (route.serverRequest) {
|
||||||
const apiClient = ServerConnections.currentApiClient();
|
const apiClient = ServerConnections.currentApiClient();
|
||||||
|
|
||||||
url = apiClient.getUrl(`/web${url}`);
|
url = apiClient.getUrl(`/web${url}`);
|
||||||
|
promise = apiClient.get(url);
|
||||||
apiClient.get(url).then(html => this.loadContent(ctx, route, html, request));
|
|
||||||
} else {
|
} else {
|
||||||
import(/* webpackChunkName: "[request]" */ `../controllers/${url}`).then((html) => {
|
promise = import(/* webpackChunkName: "[request]" */ `../controllers/${url}`);
|
||||||
this.loadContent(ctx, route, html, request);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
promise.then((html) => {
|
||||||
|
this.loadContent(ctx, route, html, request);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRoute(ctx, next, route) {
|
handleRoute(ctx, next, route) {
|
||||||
|
Loading…
Reference in New Issue
Block a user