Fix default phone region validation

Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
Christopher Ng 2023-01-05 00:23:49 +00:00 committed by nextcloud-command
parent 4694287410
commit 9bcfa5ecba
4 changed files with 11 additions and 4 deletions

View file

@ -154,6 +154,7 @@ class PersonalInfo implements ISettings {
'displayName' => $this->getProperty($account, IAccountManager::PROPERTY_DISPLAYNAME),
'emailMap' => $this->getEmailMap($account),
'phone' => $this->getProperty($account, IAccountManager::PROPERTY_PHONE),
'defaultPhoneRegion' => $this->config->getSystemValueString('default_phone_region'),
'location' => $this->getProperty($account, IAccountManager::PROPERTY_ADDRESS),
'website' => $this->getProperty($account, IAccountManager::PROPERTY_WEBSITE),
'twitter' => $this->getProperty($account, IAccountManager::PROPERTY_TWITTER),

View file

@ -35,7 +35,10 @@ import AccountPropertySection from './shared/AccountPropertySection.vue'
import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.js'
const { phone } = loadState('settings', 'personalInfoParameters', {})
const {
defaultPhoneRegion,
phone,
} = loadState('settings', 'personalInfoParameters', {})
export default {
name: 'PhoneSection',
@ -52,6 +55,9 @@ export default {
methods: {
onValidate(value) {
if (defaultPhoneRegion) {
return isValidPhoneNumber(value, defaultPhoneRegion)
}
return isValidPhoneNumber(value)
},
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long