Bug 1644345 Comment 14 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Review of attachment 9156659 [details] [diff] [review]:
-----------------------------------------------------------------

We also want to add ``ToggleReturnReceipt()`` in the ``ComposeStartup()`` to reflect the initial state user has set up in the preference or the account settings. In that, we just want to update the UI state. So the call should be ``msgCompFields.returnReceipt(msgCompFields.returnReceipt)``;

::: mail/components/compose/content/MsgComposeCommands.js
@@ +5367,4 @@
>      gReceiptOptionChanged = true;
> +  } else {
> +    if (msgCompFields.returnReceipt != forcedState) {
> +      gReceiptOptionChanged = true;

This will create problems.

@@ +7081,5 @@
>          prevReceipt == msgCompFields.returnReceipt &&
>          prevReceipt != newReceipt
>        ) {
>          msgCompFields.returnReceipt = newReceipt;
> +        ToggleReturnReceipt();

It should be ``ToggleReturnReceipt(newReceipt)`` and remove the ``msgCompFields.returnReceipt = newReceipt;``
``ToggleReturnReceipt();``(without arguement) will re-toggle the state. 
But with ``ToggleReturnReceipt(newReceipt)``, gReceiptOptionChanged will be true and we don't want that here. It will show save changes dialog when the user tries to close the compose window but actually, user is not changing any state of the compose window.
Review of attachment 9156659 [details] [diff] [review]:
-----------------------------------------------------------------

We also want to add ToggleReturnReceipt() in the ComposeStartup() to reflect the initial state user has set up in the preference or the account settings. In that, we just want to update the UI state. So the call should be msgCompFields.returnReceipt(msgCompFields.returnReceipt);

::: mail/components/compose/content/MsgComposeCommands.js
@@ +5367,4 @@
>      gReceiptOptionChanged = true;
> +  } else {
> +    if (msgCompFields.returnReceipt != forcedState) {
> +      gReceiptOptionChanged = true;

This will create problems.

@@ +7081,5 @@
>          prevReceipt == msgCompFields.returnReceipt &&
>          prevReceipt != newReceipt
>        ) {
>          msgCompFields.returnReceipt = newReceipt;
> +        ToggleReturnReceipt();

It should be ToggleReturnReceipt(newReceipt) and remove the msgCompFields.returnReceipt = newReceipt;
ToggleReturnReceipt();(without arguement) will re-toggle the state. 
But with ToggleReturnReceipt(newReceipt), gReceiptOptionChanged will be true and we don't want that here. It will show save changes dialog when the user tries to close the compose window but actually, user is not changing any state of the compose window.

Back to Bug 1644345 Comment 14