diff --git a/desktop/flipper-ui/src/sandy-chrome/appinspect/LaunchEmulator.tsx b/desktop/flipper-ui/src/sandy-chrome/appinspect/LaunchEmulator.tsx index 94e79da7a0f..85235ab171d 100644 --- a/desktop/flipper-ui/src/sandy-chrome/appinspect/LaunchEmulator.tsx +++ b/desktop/flipper-ui/src/sandy-chrome/appinspect/LaunchEmulator.tsx @@ -98,15 +98,15 @@ export const LaunchEmulatorDialog = withTrackingScope( const [iOSMessage, setiOSMessage] = useState({type: 'loading'}); const [androidMessage, setAndroidMessage] = useState('Loading...'); - const [favoriteVirtualDevices, setFavoriteVirtualDevices] = + const [favoriteVirtualDeviceIds, setFavoriteVirtualDeviceIds] = useLocalStorageState('favourite-virtual-devices', []); - const addToFavorites = (deviceName: string) => { - setFavoriteVirtualDevices(uniq([deviceName, ...favoriteVirtualDevices])); + const addToFavorites = (id: string) => { + setFavoriteVirtualDeviceIds(uniq([id, ...favoriteVirtualDeviceIds])); }; - const removeFromFavorites = (deviceName: string) => { - setFavoriteVirtualDevices(without(favoriteVirtualDevices, deviceName)); + const removeFromFavorites = (deviceId: string) => { + setFavoriteVirtualDeviceIds(without(favoriteVirtualDeviceIds, deviceId)); }; const [pendingEmulators, setPendingEmulators] = useState(new Set()); @@ -185,7 +185,7 @@ export const LaunchEmulatorDialog = withTrackingScope( ...chain( androidEmulators.map((name) => ({ name, - isFavorite: favoriteVirtualDevices.includes(name), + isFavorite: favoriteVirtualDeviceIds.includes(name), })), ) .sortBy((item) => [!item.isFavorite, item.name]) @@ -235,7 +235,7 @@ export const LaunchEmulatorDialog = withTrackingScope( addToFavorites={addToFavorites} removeFromFavorites={removeFromFavorites} isFavorite={isFavorite} - name={name}> + id={name}> } @@ -258,7 +258,7 @@ export const LaunchEmulatorDialog = withTrackingScope( ...chain(iosEmulators) .map((device) => ({ device, - isFavorite: favoriteVirtualDevices.includes(device.name), + isFavorite: favoriteVirtualDeviceIds.includes(device.udid), })) .sortBy((item) => [!item.isFavorite, item.device.name]) .map(({device, isFavorite}) => ( @@ -267,7 +267,7 @@ export const LaunchEmulatorDialog = withTrackingScope( addToFavorites={addToFavorites} removeFromFavorites={removeFromFavorites} isFavorite={isFavorite} - name={device.name}> + id={device.udid}>