Skip to content

Commit 397a521

Browse files
NuckleMrBurrBurr
andauthored
Fix ASF-ui wrong password format (#1705)
* Fix ASF-ui wrong password format * Remove unnecessary optional chaining operator --------- Co-authored-by: FREDERICK <[email protected]>
1 parent 57b98e6 commit 397a521

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/views/ASFConfig.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,13 @@
100100
// if we got routed to asf-config with params, we propably
101101
// came from PasswordHash.vue and want to set ipc data from params
102102
if (Object.keys(this.$route.params).length !== 0) {
103-
this.model.IPCPassword = this.$route.params?.ipcPassword;
104-
this.model.IPCPasswordFormat = this.$route.params?.ipcPasswordFormat;
103+
// only set the values if they exist in the params
104+
if (typeof this.$route.params.ipcPassword !== 'undefined') {
105+
this.model.IPCPassword = this.$route.params.ipcPassword;
106+
}
107+
if (typeof this.$route.params.ipcPasswordFormat !== 'undefined') {
108+
this.model.IPCPasswordFormat = this.$route.params.ipcPasswordFormat;
109+
}
105110
}
106111
107112
const extendedFields = {

src/views/modals/BotConfig.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,13 @@
102102
// if we got routed to bot-config with params, we propably
103103
// came from PasswordEncrypt.vue and want to set password data from params
104104
if (Object.keys(this.$route.params).length !== 0) {
105-
this.model.SteamPassword = this.$route.params?.steamPassword;
106-
this.model.PasswordFormat = this.$route.params?.passwordFormat;
105+
// only set the values if they exist in the params
106+
if (typeof this.$route.params.steamPassword !== 'undefined') {
107+
this.model.SteamPassword = this.$route.params.steamPassword;
108+
}
109+
if (typeof this.$route.params.passwordFormat !== 'undefined') {
110+
this.model.PasswordFormat = this.$route.params.passwordFormat;
111+
}
107112
}
108113
109114
const extendedFields = {

0 commit comments

Comments
 (0)