Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do not disable send password by Talk without setting new password in UI
Before it was possible to disable "send password by Talk" without
setting a new password, so the UI allowed that. Now that the server
prevents it the UI had to be adjusted to not update the share until a
new password is set when "send password by Talk" is disabled.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
  • Loading branch information
danxuliu committed Jun 1, 2020
commit eb1b893fe5e8c7968c85be4817e4a8d7bc4124c3
2 changes: 1 addition & 1 deletion core/js/dist/share_backend.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/share_backend.js.map

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions core/js/sharedialogshareelistview.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,7 @@
shareNote: shareNote,
hasNote: shareNote !== '',
expireDate: moment(this.model.getExpireDate(shareIndex), 'YYYY-MM-DD').format('DD-MM-YYYY'),
// The password placeholder does not take into account if
// sending the password by Talk is enabled or not; when
// switching from sending the password by Talk to sending the
// password by email the password is reused and the share
// updated, so the placeholder already shows the password in the
// brief time between disabling sending the password by email
// and receiving the updated share.
passwordPlaceholder: hasPassword ? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE,
passwordPlaceholder: (hasPassword && !sendPasswordByTalk) ? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE,
passwordByTalkPlaceholder: (hasPassword && sendPasswordByTalk)? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE,
});
},
Expand Down Expand Up @@ -575,10 +568,11 @@
passwordContainer.toggleClass('hidden', !state);
} else if (state) {
if (passwordByTalkState) {
// Switching from sending the password by Talk to sending
// the password by mail can be done keeping the previous
// password sent by Talk.
this.model.updateShare(shareId, {sendPasswordByTalk: false});
// Disabling sending the password by Talk requires a new
// password to be given (the already set password is hashed,
// so it is not possible to send it by mail), so the share
// is not updated until the user explicitly gives the new
// password.

var passwordByTalkContainerClass = '.passwordByTalkMenu-' + this.cid + '-' + shareId;
var passwordByTalkContainer = $(passwordByTalkContainerClass);
Expand Down