|
@@ -198,9 +198,9 @@
|
|
|
<!-- password protected by Talk -->
|
|
|
<ActionCheckbox v-if="isPasswordProtectedByTalkAvailable"
|
|
|
:checked.sync="isPasswordProtectedByTalk"
|
|
|
- :disabled="saving"
|
|
|
+ :disabled="!canTogglePasswordProtectedByTalkAvailable || saving"
|
|
|
class="share-link-password-talk-checkbox"
|
|
|
- @change="queueUpdate('sendPasswordByTalk')">
|
|
|
+ @change="onPasswordProtectedByTalkChange">
|
|
|
{{ t('files_sharing', 'Video verification') }}
|
|
|
</ActionCheckbox>
|
|
|
|
|
@@ -481,6 +481,20 @@ export default {
|
|
|
: false
|
|
|
},
|
|
|
|
|
|
+ canTogglePasswordProtectedByTalkAvailable() {
|
|
|
+ if (!this.isPasswordProtected) {
|
|
|
+ // Makes no sense
|
|
|
+ return false
|
|
|
+ } else if (this.isEmailShareType && !this.hasUnsavedPassword) {
|
|
|
+ // For email shares we need a new password in order to enable or
|
|
|
+ // disable
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ // Anything else should be fine
|
|
|
+ return true
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* Pending data.
|
|
|
* If the share still doesn't have an id, it is not synced
|
|
@@ -792,6 +806,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * Update the password along with "sendPasswordByTalk".
|
|
|
+ *
|
|
|
+ * If the password was modified the new password is sent; otherwise
|
|
|
+ * updating a mail share would fail, as in that case it is required that
|
|
|
+ * a new password is set when enabling or disabling
|
|
|
+ * "sendPasswordByTalk".
|
|
|
+ */
|
|
|
+ onPasswordProtectedByTalkChange() {
|
|
|
+ if (this.hasUnsavedPassword) {
|
|
|
+ this.share.password = this.share.newPassword.trim()
|
|
|
+ }
|
|
|
+
|
|
|
+ this.queueUpdate('sendPasswordByTalk', 'password')
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* Save potential changed data on menu close
|
|
|
*/
|