mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-10-26 16:45:26 +00:00
Immediately load device information in nativeshell
(cherry picked from commit bc98e23b4c)
This commit is contained in:
1 parent
d92e6e9dc3
commit
9d8544b955
1 file changed
+2
-23
@@ -29,10 +29,7 @@ for (const plugin of plugins) {
|
||||
};
|
||||
}
|
||||
|
||||
let deviceId;
|
||||
let deviceName;
|
||||
let appName;
|
||||
let appVersion;
|
||||
const { deviceId, deviceName, appName, appVersion } = JSON.parse(window.NativeInterface.getDeviceInformation());
|
||||
|
||||
window.NativeShell = {
|
||||
enableFullscreen() {
|
||||
@@ -144,25 +141,7 @@ function getDeviceProfile(profileBuilder, item) {
|
||||
}
|
||||
|
||||
window.NativeShell.AppHost = {
|
||||
init() {
|
||||
try {
|
||||
const result = JSON.parse(window.NativeInterface.getDeviceInformation());
|
||||
// set globally so they can be used elsewhere
|
||||
deviceId = result.deviceId;
|
||||
deviceName = result.deviceName;
|
||||
appName = result.appName;
|
||||
appVersion = result.appVersion;
|
||||
|
||||
return Promise.resolve({
|
||||
deviceId,
|
||||
deviceName,
|
||||
appName,
|
||||
appVersion,
|
||||
});
|
||||
} catch (e) {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
},
|
||||
init() {},
|
||||
getDefaultLayout() {
|
||||
return "mobile";
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user