Immediately load device information in nativeshell

(cherry picked from commit bc98e23b4c)
This commit is contained in:
Niels van Velzen committed 2026-04-03 19:38:23 +02:00
1 parent d92e6e9dc3
commit 9d8544b955
1 file changed
+2 -23
+2 -23
View File
@@ -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";
},