Skip to content

Commit

Permalink
Fix disabled federated scope
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Oct 27, 2022
1 parent 5e71875 commit e87b71b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/settings/lib/Settings/Personal/PersonalInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public function getForm(): TemplateResponse {
$messageParameters = $this->getMessageParameters($account);

$parameters = [
'federationEnabled' => $federationEnabled,
'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(),
'profileEnabledGlobally' => $this->profileManager->isProfileEnabled(),
Expand Down Expand Up @@ -171,6 +170,7 @@ public function getForm(): TemplateResponse {
$accountParameters = [
'avatarChangeSupported' => $user->canChangeAvatar(),
'displayNameChangeSupported' => $user->canChangeDisplayName(),
'federationEnabled' => $federationEnabled,
'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ import {
import { savePrimaryAccountPropertyScope } from '../../../service/PersonalInfo/PersonalInfoService.js'
import logger from '../../../logger.js'
const { lookupServerUploadEnabled } = loadState('settings', 'accountParameters', {})
const {
federationEnabled,
lookupServerUploadEnabled,
} = loadState('settings', 'accountParameters', {})
export default {
name: 'FederationControl',
Expand Down Expand Up @@ -120,15 +123,21 @@ export default {
},
supportedScopes() {
if (lookupServerUploadEnabled && !UNPUBLISHED_READABLE_PROPERTIES.includes(this.readable)) {
return [
...PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable],
SCOPE_ENUM.FEDERATED,
SCOPE_ENUM.PUBLISHED,
]
const scopes = PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable]
if (UNPUBLISHED_READABLE_PROPERTIES.includes(this.readable)) {
return scopes
}
if (federationEnabled) {
scopes.push(SCOPE_ENUM.FEDERATED)
}
if (lookupServerUploadEnabled) {
scopes.push(SCOPE_ENUM.PUBLISHED)
}
return PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable]
return scopes
},
},
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-info.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-info.js.map

Large diffs are not rendered by default.

0 comments on commit e87b71b

Please sign in to comment.