Replace usage of getDeviceInfo with isMobile

We were using getDeviceInfo to check whether we were on a desktop or a
mobile device. This can be done more simply with isMobile, which means
we can stop exporting getDeviceInfo.
This commit is contained in:
valadaptive
2023-12-14 18:03:10 -05:00
parent 0f42bd4a95
commit fbdfa05f81
5 changed files with 12 additions and 18 deletions

View File

@@ -113,7 +113,7 @@ export function isMobile() {
* Loads device info from the server. Caches the result in sessionStorage.
* @returns {object} - The device info object.
*/
export function getDeviceInfo() {
function getDeviceInfo() {
let deviceInfo = null;
if (sessionStorage.getItem('deviceInfo')) {
@@ -431,8 +431,7 @@ function RA_autoconnect(PrevApi) {
}
function OpenNavPanels() {
const deviceInfo = getDeviceInfo();
if (deviceInfo && deviceInfo.device.type === 'desktop') {
if (!isMobile()) {
//auto-open R nav if locked and previously open
if (LoadLocalBool('NavLockOn') == true && LoadLocalBool('NavOpened') == true) {
//console.log("RA -- clicking right nav to open");