Always process messages for navigation plugin

Summary: For the navigation plugin we want to opt-out from the "enabled" and "process messages later" optimizations, because it's events should be immediately processed to reflect the changes in the topbar for navigation purposes

Reviewed By: jknoxville

Differential Revision: D19554297

fbshipit-source-id: 4bd49b5d1327feea6dea52e86d9dbc9d54a5dbee
This commit is contained in:
Michel Weststrate
2020-01-27 04:02:24 -08:00
committed by Facebook Github Bot
parent cedb9617c4
commit 434d75f362

View File

@@ -174,6 +174,7 @@ export function processMessageLater(
const isSelected =
pluginKey === getSelectedPluginKey(store.getState().connections);
switch (true) {
case plugin.id === 'Navigation': // Navigation events are always processed, to make sure the navbar stays up to date
case isSelected && getPendingMessages(store, pluginKey).length === 0:
processMessageImmediately(store, pluginKey, plugin, message);
break;
@@ -189,6 +190,7 @@ export function processMessageLater(
),
);
break;
// In all other cases, messages will be dropped...
}
}