fix some javascript errors when adding users

This commit is contained in:
dni ⚡ 2022-09-22 15:55:37 +02:00
parent 7c05d4c354
commit 415165c6fe

View File

@ -1221,7 +1221,7 @@
addAdminUser() { addAdminUser() {
let addUser = this.data.admin_users_add let addUser = this.data.admin_users_add
let admin_users = this.data.admin.admin_users let admin_users = this.data.admin.admin_users
if (addUser.length && !admin_users.includes(addUser)) { if (addUser && addUser.length && !admin_users.includes(addUser)) {
admin_users.push(addUser) admin_users.push(addUser)
this.data.admin.admin_users = admin_users this.data.admin.admin_users = admin_users
this.data.admin_users_add = '' this.data.admin_users_add = ''
@ -1234,7 +1234,7 @@
addAllowedUser() { addAllowedUser() {
let addUser = this.data.allowed_users_add let addUser = this.data.allowed_users_add
let allowed_users = this.data.admin.allowed_users let allowed_users = this.data.admin.allowed_users
if (addUser.length && !allowed_users.includes(addUser)) { if (addUser && addUser.length && !allowed_users.includes(addUser)) {
allowed_users.push(addUser) allowed_users.push(addUser)
this.data.admin.allowed_users = allowed_users this.data.admin.allowed_users = allowed_users
this.data.allowed_users_add = '' this.data.allowed_users_add = ''
@ -1336,7 +1336,6 @@
custom_logo, custom_logo,
ad_space ad_space
} = this.data.admin } = this.data.admin
//console.log("this", this.data.admin)
let data = { let data = {
admin_users: admin_users.toString(), admin_users: admin_users.toString(),
allowed_users: allowed_users.toString(), allowed_users: allowed_users.toString(),