Set correct platform for the Heynote web app

This commit is contained in:
Jonatan Heyman 2023-12-28 18:01:10 +01:00
parent 6022356478
commit 6bbad360d4

View File

@ -9,12 +9,30 @@ mediaMatch.addEventListener("change", async (event) => {
let autoUpdateCallbacks = null
let currencyData = null
const Heynote = {
platform: {
let platform
const uaPlatform = window.navigator?.userAgentData?.platform || window.navigator.platform
if (uaPlatform.indexOf("Win") !== -1) {
platform = {
isMac: false,
isWindows: true,
isLinux: false,
}
} else if (uaPlatform.indexOf("Linux") !== -1) {
platform = {
isMac: false,
isWindows: false,
isLinux: true,
}
} else {
platform = {
isMac: true,
isWindows: false,
isLinux: false,
},
}
}
const Heynote = {
platform: platform,
buffer: {
async load() {