signal-desktop/ts/set_os_class.ts

18 lines
447 B
TypeScript
Raw Normal View History

2021-02-01 20:01:25 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2022-05-31 21:42:18 +00:00
{
2021-02-01 20:01:25 +00:00
let className: string;
if (window.Signal.OS.isWindows()) {
className = 'os-windows';
} else if (window.Signal.OS.isMacOS()) {
className = 'os-macos';
} else if (window.Signal.OS.isLinux()) {
className = 'os-linux';
} else {
throw new Error('Unexpected operating system; not applying ');
}
2022-05-31 21:42:18 +00:00
document.body.classList.add(className);
}