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