fix some javascript errors when adding users

This commit is contained in:
dni ⚡ 2022-09-22 15:55:37 +02:00
parent 11393ef7e9
commit 0beb112d5b

View File

@ -1221,7 +1221,7 @@
addAdminUser() {
let addUser = this.data.admin_users_add
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)
this.data.admin.admin_users = admin_users
this.data.admin_users_add = ''
@ -1234,7 +1234,7 @@
addAllowedUser() {
let addUser = this.data.allowed_users_add
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)
this.data.admin.allowed_users = allowed_users
this.data.allowed_users_add = ''
@ -1336,7 +1336,6 @@
custom_logo,
ad_space
} = this.data.admin
//console.log("this", this.data.admin)
let data = {
admin_users: admin_users.toString(),
allowed_users: allowed_users.toString(),