1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Fix an issue when deleting the entire content of an unsubmitted inline comment

Summary: Ref T12733. In this case, the server returns no new `row`, but we would incorrectly try to bind to one.

Test Plan:
  - Created a new comment.
  - Edited it.
  - Deleted all the text.
  - Saved changes.
  - Before: Header continues to show phantom "1 Unsubmitted Comment", browser error log reflects one error.
  - After: Header reflects comment being deleted, error log is quiet.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

Differential Revision: https://secure.phabricator.com/D18262
This commit is contained in:
epriestley 2017-07-21 08:08:24 -07:00
parent 27a243cd88
commit 0d8f4170f4
2 changed files with 14 additions and 7 deletions

View file

@ -13,7 +13,7 @@ return array(
'core.pkg.js' => '5d80e0db',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '45951e9e',
'differential.pkg.js' => '1d80ecc6',
'differential.pkg.js' => '414ada25',
'diffusion.pkg.css' => 'a2d17c7d',
'diffusion.pkg.js' => '6134c5a1',
'favicon.ico' => '30672e08',
@ -399,7 +399,7 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/DiffChangeset.js' => '99abf4cd',
'rsrc/js/application/diff/DiffChangesetList.js' => 'cb1570cb',
'rsrc/js/application/diff/DiffInline.js' => '1bfa31c7',
'rsrc/js/application/diff/DiffInline.js' => 'e83d28f3',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07',
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
@ -779,7 +779,7 @@ return array(
'phabricator-dashboard-css' => 'fe5b1869',
'phabricator-diff-changeset' => '99abf4cd',
'phabricator-diff-changeset-list' => 'cb1570cb',
'phabricator-diff-inline' => '1bfa31c7',
'phabricator-diff-inline' => 'e83d28f3',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
'phabricator-fatal-config-template-css' => '8f18fa41',
@ -1020,9 +1020,6 @@ return array(
'javelin-request',
'javelin-uri',
),
'1bfa31c7' => array(
'javelin-dom',
),
'1e911d0f' => array(
'javelin-stratcom',
'javelin-request',
@ -2094,6 +2091,9 @@ return array(
'javelin-workflow',
'javelin-magical-init',
),
'e83d28f3' => array(
'javelin-dom',
),
'e9581f08' => array(
'javelin-behavior',
'javelin-stratcom',

View file

@ -702,7 +702,14 @@ JX.install('DiffInline', {
JX.DOM.remove(this._row);
}
this.bindToRow(new_row);
// If you delete the content on a comment and save it, it acts like a
// delete: the server does not return a new row.
if (new_row) {
this.bindToRow(new_row);
} else {
this.setDeleted(true);
this._row = null;
}
this._didUpdate();
},