77 <NcSettingsSection
88 :name =" t('sharebymail', 'Share by mail')"
99 :description =" t('sharebymail', 'Allows people to share a personalized link to a file or folder by putting in an email address.')" >
10- <NcCheckboxRadioSwitch
11- type =" switch"
12- :checked.sync =" sendPasswordMail"
13- @update:checked =" update('sendpasswordmail', sendPasswordMail)" >
10+ <NcCheckboxRadioSwitch v-model =" sendPasswordMail" type =" switch" >
1411 {{ t('sharebymail', 'Send password by mail') }}
1512 </NcCheckboxRadioSwitch >
1613
17- <NcCheckboxRadioSwitch
18- type =" switch"
19- :checked.sync =" replyToInitiator"
20- @update:checked =" update('replyToInitiator', replyToInitiator)" >
14+ <NcCheckboxRadioSwitch v-model =" replyToInitiator" type =" switch" >
2115 {{ t('sharebymail', 'Reply to initiator') }}
2216 </NcCheckboxRadioSwitch >
2317 </NcSettingsSection >
2721import axios from ' @nextcloud/axios'
2822import { showError } from ' @nextcloud/dialogs'
2923import { loadState } from ' @nextcloud/initial-state'
24+ import { t } from ' @nextcloud/l10n'
3025import { confirmPassword } from ' @nextcloud/password-confirmation'
3126import { generateOcsUrl } from ' @nextcloud/router'
3227import NcCheckboxRadioSwitch from ' @nextcloud/vue/components/NcCheckboxRadioSwitch'
@@ -40,13 +35,27 @@ export default {
4035 NcSettingsSection,
4136 },
4237
38+ setup () {
39+ return { t }
40+ },
41+
4342 data () {
4443 return {
4544 sendPasswordMail: loadState (' sharebymail' , ' sendPasswordMail' ),
4645 replyToInitiator: loadState (' sharebymail' , ' replyToInitiator' ),
4746 }
4847 },
4948
49+ watch: {
50+ sendPasswordMail (newValue ) {
51+ this .update (' sendpasswordmail' , newValue)
52+ },
53+
54+ replyToInitiator (newValue ) {
55+ this .update (' replyToInitiator' , newValue)
56+ },
57+ },
58+
5059 methods: {
5160 async update (key , value ) {
5261 await confirmPassword ()
0 commit comments