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

@ -169,7 +169,6 @@ import {
import { EventEmitter } from './lib/eventemitter.js';
import { markdownExclusionExt } from './scripts/showdown-exclusion.js';
import { NOTE_MODULE_NAME, initAuthorsNote, metadata_keys, setFloatingPrompt, shouldWIAddPrompt } from './scripts/authors-note.js';
import { getDeviceInfo } from './scripts/RossAscends-mods.js';
import { registerPromptManagerMigration } from './scripts/PromptManager.js';
import { getRegexedString, regex_placement } from './scripts/extensions/regex/engine.js';
import { FILTER_TYPES, FilterHelper } from './scripts/filters.js';
@ -6834,8 +6833,7 @@ function openCharacterWorldPopup() {
template.find('.character_name').text(name);
// Not needed on mobile
const deviceInfo = getDeviceInfo();
if (deviceInfo && deviceInfo.device.type === 'desktop') {
if (!isMobile()) {
$(extraSelect).select2({
width: '100%',
placeholder: 'No auxillary Lorebooks set. Click here to select.',
@ -7812,7 +7810,7 @@ function addDebugFunctions() {
jQuery(async function () {
if (isMobile() === true) {
if (isMobile()) {
console.debug('hiding movingUI and sheldWidth toggles for mobile');
$('#sheldWidthToggleBlock').hide();
$('#movingUIModeCheckBlock').hide();