1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Conpherence - fix 0 messages in header race condition

Summary:
Fixes T7545. Turns out we had the right logic to handle this basically, and just needed to variablize the CSS class that gets added / removed as appropos.

Note the new behavior is to keep the icon highlighted just with no number. This emulates how it would work if e.g. there was no unread message in the first place and you just clicked the message icon to invoke the message menu.

Test Plan: had a durable conpherence open for user A with user B. used a separate browser to send message as user B. reloaded as user A - saw new message in conpherence durable column and the "1" unread icon. I then clicked the "1" and saw it disappear as expected

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7545

Differential Revision: https://secure.phabricator.com/D12091
This commit is contained in:
Bob Trahan 2015-03-16 14:28:25 -07:00
parent cf54194ef5
commit c21301d153
3 changed files with 17 additions and 15 deletions

View file

@ -8,7 +8,7 @@
return array(
'names' => array(
'core.pkg.css' => 'a7f3dc55',
'core.pkg.js' => '69f7e542',
'core.pkg.js' => '75599122',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '1940be3f',
'differential.pkg.js' => '85fd84c6',
@ -347,7 +347,7 @@ return array(
'rsrc/image/texture/table_header_hover.png' => '038ec3b9',
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
'rsrc/js/application/aphlict/Aphlict.js' => '2be71d56',
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '830b3278',
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '00def500',
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'bdf2226d',
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
@ -543,7 +543,7 @@ return array(
'inline-comment-summary-css' => 'eb5f8e8c',
'javelin-aphlict' => '2be71d56',
'javelin-behavior' => '61cbc29a',
'javelin-behavior-aphlict-dropdown' => '830b3278',
'javelin-behavior-aphlict-dropdown' => '00def500',
'javelin-behavior-aphlict-listen' => 'bdf2226d',
'javelin-behavior-aphlict-status' => 'ea681761',
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
@ -832,6 +832,16 @@ return array(
'unhandled-exception-css' => '37d4f9a2',
),
'requires' => array(
'00def500' => array(
'javelin-behavior',
'javelin-request',
'javelin-stratcom',
'javelin-vector',
'javelin-dom',
'javelin-uri',
'javelin-behavior-device',
'phabricator-title',
),
'0286a1db' => array(
'javelin-dom',
'javelin-util',
@ -1432,16 +1442,6 @@ return array(
'82ce2142' => array(
'aphront-typeahead-control-css',
),
'830b3278' => array(
'javelin-behavior',
'javelin-request',
'javelin-stratcom',
'javelin-vector',
'javelin-dom',
'javelin-uri',
'javelin-behavior-device',
'phabricator-title',
),
'834a1173' => array(
'javelin-behavior',
'javelin-scrollbar',

View file

@ -375,6 +375,7 @@ final class PhabricatorMainMenuView extends AphrontView {
'uri' => '/conpherence/panel/',
'countType' => 'messages',
'countNumber' => $message_count_number,
'unreadClass' => 'message-unread',
));
$message_notification_dropdown = javelin_tag(
@ -458,6 +459,7 @@ final class PhabricatorMainMenuView extends AphrontView {
'uri' => '/notification/panel/',
'countType' => 'notifications',
'countNumber' => $count_number,
'unreadClass' => 'alert-unread',
));
$notification_dropdown = javelin_tag(

View file

@ -49,9 +49,9 @@ JX.behavior('aphlict-dropdown', function(config, statics) {
JX.DOM.setContent(count, display);
if (response.number === 0) {
JX.DOM.alterClass(bubble, 'alert-unread', false);
JX.DOM.alterClass(bubble, config.unreadClass, false);
} else {
JX.DOM.alterClass(bubble, 'alert-unread', true);
JX.DOM.alterClass(bubble, config.unreadClass, true);
}
dirty = false;
JX.DOM.alterClass(