mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 22:03:50 +02:00
fix statusbar
This commit is contained in:
@@ -278,7 +278,6 @@
|
||||
|
||||
const wsCanvasRef = ref(null);
|
||||
const now = useNow({ interval: 1000 });
|
||||
const appStartAt = dayjs();
|
||||
|
||||
useIntervalFn(() => {
|
||||
const delta = wsState.messageCount - lastMsgCount;
|
||||
@@ -360,13 +359,14 @@
|
||||
});
|
||||
|
||||
const appUptimeText = computed(() => {
|
||||
const elapsedSeconds = dayjs(now.value).diff(appStartAt, 'second');
|
||||
const elapsedSeconds = Math.floor((now.value - vrcxStore.appStartAt) / 1000);
|
||||
return formatAppUptime(elapsedSeconds);
|
||||
});
|
||||
|
||||
const CLOCKS_KEY = 'VRCX_statusBarClocks';
|
||||
const CLOCK_COUNT_KEY = 'VRCX_statusBarClockCount';
|
||||
const defaultClocks = [{ offset: normalizeUtcHour(dayjs().utcOffset() / 60) }, { offset: 0 }, { offset: -5 }];
|
||||
const localOffset = normalizeUtcHour(dayjs().utcOffset() / 60);
|
||||
const defaultClocks = [{ offset: localOffset }, { offset: 0 }, { offset: localOffset < 0 ? 9 : -5 }];
|
||||
|
||||
const clocks = ref(loadClocks(localStorage, defaultClocks));
|
||||
const clockCount = ref(loadClockCount(localStorage));
|
||||
@@ -397,6 +397,7 @@
|
||||
/**
|
||||
*
|
||||
* @param clock
|
||||
* @returns {string}
|
||||
*/
|
||||
function formatClock(clock) {
|
||||
try {
|
||||
@@ -501,7 +502,8 @@
|
||||
align-items: center;
|
||||
background: var(--sidebar);
|
||||
border-top: 1px solid var(--border);
|
||||
font-size: 11px;
|
||||
font-family: 'Consolas', 'Courier New', monospace;
|
||||
font-size: 12px;
|
||||
user-select: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -578,7 +580,6 @@
|
||||
}
|
||||
|
||||
.status-label-mono {
|
||||
font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
|
||||
font-size: 10px;
|
||||
color: hsl(var(--foreground));
|
||||
}
|
||||
|
||||
@@ -83,7 +83,11 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
const maxTableSize = ref(DEFAULT_MAX_TABLE_SIZE);
|
||||
const searchLimit = ref(DEFAULT_SEARCH_LIMIT);
|
||||
const proxyServer = ref('');
|
||||
const appStartAt = Date.now();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function init() {
|
||||
if (LINUX) {
|
||||
window.electron.ipcRenderer.on('launch-command', (command) => {
|
||||
@@ -176,6 +180,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
|
||||
init();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function updateDatabaseVersion() {
|
||||
// requires dbVars.userPrefix to be already set
|
||||
const databaseVersion = 13;
|
||||
@@ -226,6 +233,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function clearVRCXCache() {
|
||||
console.log('Clearing VRCX cache...');
|
||||
failedGetRequests.clear();
|
||||
@@ -280,6 +290,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
galleryStore.cachedEmoji.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
function eventVrcxMessage(data) {
|
||||
let entry;
|
||||
switch (data.MsgType) {
|
||||
@@ -337,6 +351,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function saveVRCXWindowOption() {
|
||||
if (LINUX) {
|
||||
VRCXStorage.Set('VRCX_LocationX', state.locationX.toString());
|
||||
@@ -347,6 +364,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param path
|
||||
*/
|
||||
async function processScreenshot(path) {
|
||||
let newPath = path;
|
||||
if (advancedSettingsStore.screenshotHelper) {
|
||||
@@ -401,6 +422,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
|
||||
// use in C# side
|
||||
/**
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
function ipcEvent(json) {
|
||||
if (!watchState.isLoggedIn) {
|
||||
return;
|
||||
@@ -537,6 +562,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
{ flush: 'sync' }
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function startupLaunchCommand() {
|
||||
const command = await AppApi.GetLaunchCommand();
|
||||
if (!command) {
|
||||
@@ -585,6 +613,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
|
||||
// called from C#
|
||||
/**
|
||||
*
|
||||
* @param input
|
||||
*/
|
||||
function eventLaunchCommand(input) {
|
||||
if (!watchState.isLoggedIn) {
|
||||
return;
|
||||
@@ -689,6 +721,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
async function backupVrcRegistry(name) {
|
||||
let regJson;
|
||||
try {
|
||||
@@ -722,6 +758,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
// await this.updateRegistryBackupDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function checkAutoBackupRestoreVrcRegistry() {
|
||||
if (
|
||||
!advancedSettingsStore.vrcRegistryAutoBackup ||
|
||||
@@ -764,10 +803,16 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function showRegistryBackupDialog() {
|
||||
isRegistryBackupDialogVisible.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function tryAutoBackupVrcRegistry() {
|
||||
if (!advancedSettingsStore.vrcRegistryAutoBackup) {
|
||||
return;
|
||||
@@ -815,6 +860,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
return {
|
||||
state,
|
||||
|
||||
appStartAt,
|
||||
proxyServer,
|
||||
currentlyDroppingFile,
|
||||
isRegistryBackupDialogVisible,
|
||||
|
||||
Reference in New Issue
Block a user