diff options
author | Zishan-7 <zishan2539@gmail.com> | 2021-08-30 18:29:28 +0530 |
---|---|---|
committer | hamza221 <hamzamahjoubi221@gmail.com> | 2023-05-22 16:43:19 +0200 |
commit | fb0709f4a4511045c8e009ebc899db3b9f5bda7f (patch) | |
tree | 4247078b69ff595e1789990cde5e932d55ea3ffa /src | |
parent | 73ef6e258f363a9bf7f44cd0e79bdff0b44450b4 (diff) |
Fix Don't show groups in share placeholder if group sharing is disabled #2242
Signed-off-by: Zishan-7 <zishan2539@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/AppNavigation/Settings/SettingsAddressbookShare.vue | 7 | ||||
-rw-r--r-- | src/services/isGroupSharingEnabled.js | 26 |
2 files changed, 32 insertions, 1 deletions
diff --git a/src/components/AppNavigation/Settings/SettingsAddressbookShare.vue b/src/components/AppNavigation/Settings/SettingsAddressbookShare.vue index 5b072b67..7fdd79c0 100644 --- a/src/components/AppNavigation/Settings/SettingsAddressbookShare.vue +++ b/src/components/AppNavigation/Settings/SettingsAddressbookShare.vue @@ -49,6 +49,7 @@ <script> import { NcSelect } from '@nextcloud/vue' import client from '../../../services/cdav.js' +import isGroupSharingEnabled from '../../../services/isGroupSharingEnabled.js' import addressBookSharee from './SettingsAddressbookSharee.vue' import debounce from 'debounce' @@ -79,7 +80,11 @@ export default { }, computed: { placeholder() { - return t('contacts', 'Share with users or groups') + if (isGroupSharingEnabled) { + return t('contacts', 'Share with users or groups') + } else { + return t('contacts', 'Share with users') + } }, noResult() { return t('contacts', 'No users or groups') diff --git a/src/services/isGroupSharingEnabled.js b/src/services/isGroupSharingEnabled.js new file mode 100644 index 00000000..b393c08e --- /dev/null +++ b/src/services/isGroupSharingEnabled.js @@ -0,0 +1,26 @@ +/** + * @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com> + * + * @author John Molakvoæ <skjnldsv@protonmail.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +import { loadState } from '@nextcloud/initial-state' + +const isGroupSharingEnabled = loadState('contacts', 'isGroupSharingEnabled', false) +export default isGroupSharingEnabled |