mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 17:30:59 +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:
parent
b048bd0593
commit
068de86fd5
2 changed files with 9 additions and 2 deletions
|
@ -1253,7 +1253,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-conpherence-menu' =>
|
'javelin-behavior-conpherence-menu' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/08fcd75a/rsrc/js/application/conpherence/behavior-menu.js',
|
'uri' => '/res/35811cd4/rsrc/js/application/conpherence/behavior-menu.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -163,8 +163,15 @@ JX.behavior('conpherence-menu', function(config) {
|
||||||
// select or load any threads. On Desktop, we automatically select the first
|
// select or load any threads. On Desktop, we automatically select the first
|
||||||
// thread.
|
// thread.
|
||||||
|
|
||||||
|
var old_device = null;
|
||||||
function ondevicechange() {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue