mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
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:
parent
4694287410
commit
9bcfa5ecba
4 changed files with 11 additions and 4 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
4
dist/settings-vue-settings-personal-info.js
vendored
4
dist/settings-vue-settings-personal-info.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue