Clean up keyboard bindings and reload locale

Co-Authored-By: kubectl <me@kube.moe>
This commit is contained in:
Natsumi
2025-11-20 21:07:42 +11:00
parent 506b709a21
commit 39a8685f0d
5 changed files with 106 additions and 74 deletions

View File

@@ -405,6 +405,7 @@
useLaunchStore,
useNotificationsSettingsStore,
usePhotonStore,
useUiStore,
useUserStore,
useVRCXUpdaterStore,
useVrStore,
@@ -430,7 +431,8 @@
const { showLaunchOptions } = useLaunchStore();
const { enablePrimaryPasswordChange } = useAuthStore();
const { cachedConfig } = storeToRefs(useAuthStore());
const { showConsole, clearVRCXCache, showRegistryBackupDialog } = useVrcxStore();
const { clearVRCXCache, showRegistryBackupDialog } = useVrcxStore();
const { showConsole } = useUiStore();
const { disableGameLogDialog } = useGameLogStore();
const { cachedUsers } = useUserStore();

View File

@@ -361,7 +361,7 @@
<script setup>
import { ArrowDown, ArrowRight, DocumentCopy, Notebook } from '@element-plus/icons-vue';
import { computed, ref } from 'vue';
import { computed, onBeforeUnmount, ref } from 'vue';
import { storeToRefs } from 'pinia';
import { useI18n } from 'vue-i18n';
@@ -425,15 +425,26 @@
const zoomLevel = ref(100);
const isLinux = computed(() => LINUX);
let cleanupWheel = null;
onBeforeUnmount(() => {
if (cleanupWheel) {
cleanupWheel();
}
});
initGetZoomLevel();
async function initGetZoomLevel() {
addEventListener('wheel', (event) => {
const handleWheel = (event) => {
if (event.ctrlKey) {
getZoomLevel();
}
});
};
window.addEventListener('wheel', handleWheel);
cleanupWheel = () => {
window.removeEventListener('wheel', handleWheel);
};
getZoomLevel();
}