From 397a521512dba2063af22986c11eb41ba2779729 Mon Sep 17 00:00:00 2001 From: Nuckle Date: Wed, 25 Dec 2024 13:35:04 +0300 Subject: [PATCH] Fix ASF-ui wrong password format (#1705) * Fix ASF-ui wrong password format * Remove unnecessary optional chaining operator --------- Co-authored-by: FREDERICK --- src/views/ASFConfig.vue | 9 +++++++-- src/views/modals/BotConfig.vue | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/views/ASFConfig.vue b/src/views/ASFConfig.vue index 30f7c9c7f..67dbad441 100644 --- a/src/views/ASFConfig.vue +++ b/src/views/ASFConfig.vue @@ -100,8 +100,13 @@ // if we got routed to asf-config with params, we propably // came from PasswordHash.vue and want to set ipc data from params if (Object.keys(this.$route.params).length !== 0) { - this.model.IPCPassword = this.$route.params?.ipcPassword; - this.model.IPCPasswordFormat = this.$route.params?.ipcPasswordFormat; + // only set the values if they exist in the params + if (typeof this.$route.params.ipcPassword !== 'undefined') { + this.model.IPCPassword = this.$route.params.ipcPassword; + } + if (typeof this.$route.params.ipcPasswordFormat !== 'undefined') { + this.model.IPCPasswordFormat = this.$route.params.ipcPasswordFormat; + } } const extendedFields = { diff --git a/src/views/modals/BotConfig.vue b/src/views/modals/BotConfig.vue index b391d310d..e4cdb1643 100644 --- a/src/views/modals/BotConfig.vue +++ b/src/views/modals/BotConfig.vue @@ -102,8 +102,13 @@ // if we got routed to bot-config with params, we propably // came from PasswordEncrypt.vue and want to set password data from params if (Object.keys(this.$route.params).length !== 0) { - this.model.SteamPassword = this.$route.params?.steamPassword; - this.model.PasswordFormat = this.$route.params?.passwordFormat; + // only set the values if they exist in the params + if (typeof this.$route.params.steamPassword !== 'undefined') { + this.model.SteamPassword = this.$route.params.steamPassword; + } + if (typeof this.$route.params.passwordFormat !== 'undefined') { + this.model.PasswordFormat = this.$route.params.passwordFormat; + } } const extendedFields = {