Fix inconsistent handling of app id and name
Summary: Changelog: Improved plugin / device / app selection handing. During some refactorings I discovered that the `connetions.selectedApp` field contained sometimes an application id, and sometimes just the name. This caused inconsistent behavior especially in unit tests. I've cleaned that up, and renamed it to `selectedAppId` where applicable, to make the distinction more clear. And, in contrast, userPreferredApp now always has a name, not an id. During refactoring our existing selection update logic was quite in the way, which was overcomplicated still, since during the sandy chrome migration, the reducers needed to be able to handle both the old UI, and the new application selection UI. That logic has been simplified now, and a lot of tests were added. As a further simplification the preferredApp/Device/Plugin are now only read and used when updating selection, but not when running selectors. Reviewed By: timur-valiev Differential Revision: D31305180 fbshipit-source-id: 2dbd9f9c33950227cc63aa29cc4a98bdd0db8e7a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ba89daf12c
commit
c9a34d3cc2
@@ -17,13 +17,13 @@ export const GLOBAL_NOTIFICATION_PLUGIN_ID = 'Flipper';
|
||||
export type PluginNotification = {
|
||||
notification: Notification;
|
||||
pluginId: string;
|
||||
client: null | string;
|
||||
client: null | string; // id
|
||||
};
|
||||
|
||||
export type PluginNotificationReference = {
|
||||
notificationId: string;
|
||||
pluginId: string;
|
||||
client: null | string;
|
||||
client: null | string; // id
|
||||
};
|
||||
|
||||
export type State = {
|
||||
|
||||
Reference in New Issue
Block a user