use utils

This commit is contained in:
liamcottle 2024-08-05 23:52:36 +12:00
parent 27015f45af
commit ec63939b7c
4 changed files with 8 additions and 3 deletions

View file

@ -255,6 +255,7 @@ import SidebarLink from "./SidebarLink.vue";
import DialogUtils from "../js/DialogUtils";
import WebSocketConnection from "../js/WebSocketConnection";
import GlobalState from "../js/GlobalState";
import Utils from "../js/Utils";
export default {
name: 'App',
@ -512,7 +513,7 @@ export default {
},
computed: {
isElectron() {
return window.electron != null;
return Utils.isElectron();
},
isMobile() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);

View file

@ -118,7 +118,7 @@ export default {
},
computed: {
isElectron() {
return window.electron != null;
return Utils.isElectron();
},
},
}

View file

@ -727,7 +727,7 @@ export default {
},
computed: {
isElectron() {
return window.electron != null;
return Utils.isElectron();
},
interfacesWithStats() {
const results = [];

View file

@ -1,5 +1,9 @@
class Utils {
static isElectron() {
return window.electron != null;
}
static formatBytes(bytes) {
if(bytes === 0){