1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 08:20:57 +01:00

Prevent double-load of Conpherence threads

Summary: We may execute the Conpherence behavior before the initial device change, in which case we'll get a desktop -> desktop device event. This currently causes us to double-load the thread list. Instead, don't do anything if the device is the same as our current understanding of device state.

Test Plan: No double thread list in profiler.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D5525
This commit is contained in:
epriestley 2013-04-02 06:44:31 -07:00
parent b048bd0593
commit 068de86fd5
2 changed files with 9 additions and 2 deletions

View file

@ -1253,7 +1253,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-conpherence-menu' =>
array(
'uri' => '/res/08fcd75a/rsrc/js/application/conpherence/behavior-menu.js',
'uri' => '/res/35811cd4/rsrc/js/application/conpherence/behavior-menu.js',
'type' => 'js',
'requires' =>
array(

View file

@ -163,8 +163,15 @@ JX.behavior('conpherence-menu', function(config) {
// select or load any threads. On Desktop, we automatically select the first
// thread.
var old_device = null;
function ondevicechange() {
if (JX.Device.getDevice() != 'desktop') {
var new_device = JX.Device.getDevice();
if (new_device === old_device) {
return;
}
old_device = new_device;
if (new_device != 'desktop') {
return;
}