diff options
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/lib/Settings/Personal/PersonalInfo.php | 1 | ||||
-rw-r--r-- | apps/settings/src/components/PersonalInfo/PhoneSection.vue | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index cf7b704e98b..535c1606527 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -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), diff --git a/apps/settings/src/components/PersonalInfo/PhoneSection.vue b/apps/settings/src/components/PersonalInfo/PhoneSection.vue index 45641cd8e14..ddb5cf33cff 100644 --- a/apps/settings/src/components/PersonalInfo/PhoneSection.vue +++ b/apps/settings/src/components/PersonalInfo/PhoneSection.vue @@ -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) }, }, |