mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 14:26:06 +02:00
prevent filcker when swtiching config
This commit is contained in:
@@ -105,7 +105,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, nextTick, ref, watch } from 'vue';
|
import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue';
|
||||||
import { CopyDocument, Warning } from '@element-plus/icons-vue';
|
import { CopyDocument, Warning } from '@element-plus/icons-vue';
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
@@ -135,6 +135,12 @@
|
|||||||
|
|
||||||
const launchDialogIndex = ref(2000);
|
const launchDialogIndex = ref(2000);
|
||||||
|
|
||||||
|
let launchAsDesktopTimeoutId;
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
clearTimeout(launchAsDesktopTimeoutId);
|
||||||
|
});
|
||||||
|
|
||||||
const launchDialog = ref({
|
const launchDialog = ref({
|
||||||
loading: false,
|
loading: false,
|
||||||
desktop: false,
|
desktop: false,
|
||||||
@@ -231,9 +237,12 @@
|
|||||||
|
|
||||||
function handleLaunchCommand(command, location, shortName) {
|
function handleLaunchCommand(command, location, shortName) {
|
||||||
const desktop = command === 'desktop';
|
const desktop = command === 'desktop';
|
||||||
launchDialog.value.desktop = desktop;
|
|
||||||
configRepository.setBool('launchAsDesktop', desktop);
|
configRepository.setBool('launchAsDesktop', desktop);
|
||||||
handleLaunchGame(location, shortName, desktop);
|
handleLaunchGame(location, shortName, desktop);
|
||||||
|
clearTimeout(launchAsDesktopTimeoutId);
|
||||||
|
launchAsDesktopTimeoutId = setTimeout(() => {
|
||||||
|
launchDialog.value.desktop = desktop;
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
function handleAttachGame(location, shortName) {
|
function handleAttachGame(location, shortName) {
|
||||||
tryOpenInstanceInVrc(location, shortName);
|
tryOpenInstanceInVrc(location, shortName);
|
||||||
|
|||||||
Reference in New Issue
Block a user