Fix react native windows (#4905)

Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/4905

Use fully qualified names in an attempt to fix the broken build.

Reviewed By: passy

Differential Revision: D47148297

fbshipit-source-id: bb2e81f62a65b9d4516a0bc4cfe2abddfc18a566
This commit is contained in:
Lorenzo Blasa
2023-07-03 04:31:49 -07:00
committed by Facebook GitHub Bot
parent c067346870
commit 54b7d8feea

View File

@@ -178,17 +178,13 @@ void FlipperReactSocketClient::connect(FlipperConnectionManager* manager) {
try { try {
status_ = Status::Initializing; status_ = Status::Initializing;
Windows::Foundation::IAsyncAction ^ connectAction; this->socket_.ConnectAsync(winrt::Windows::Foundation::Uri(uri))
connectAction = .Completed([&](auto&& asyncInfo, auto&& asyncStatus) {
this->socket_.ConnectAsync(winrt::Windows::Foundation::Uri(uri)); if (asyncStatus ==
connectAction->Completed = ref new AsyncActionCompletedHandler( winrt::Windows::Foundation::AsyncStatus::Completed) {
[eventHandler = eventHandler_]( eventHandler_(SocketEvent::OPEN);
Windows::Foundation::IAsyncAction ^ asyncAction,
Windows::Foundation::AsyncStatus asyncStatus) {
if (asyncStatus == Windows::Foundation::AsyncStatus::Completed) {
eventHandler(SocketEvent::OPEN);
} else { } else {
eventHandler(SocketEvent::ERROR); eventHandler_(SocketEvent::ERROR);
} }
}); });
@@ -198,7 +194,7 @@ void FlipperReactSocketClient::connect(FlipperConnectionManager* manager) {
ex.to_abi())}; ex.to_abi())};
socket_ = nullptr; socket_ = nullptr;
status_ = Status::Unconnected; status_ = Status::Unconnected;
eventHandler(SocketEvent::ERROR); eventHandler_(SocketEvent::ERROR);
} }
} }
@@ -273,10 +269,11 @@ void FlipperReactSocketClient::OnWebSocketMessageReceived(
const std::string payload = winrt::to_string(message); const std::string payload = winrt::to_string(message);
if (overrideHandler_ != nullptr) { if (overrideHandler_ != nullptr) {
auto messageHandler = *overrideHandler_;
messageHandler(payload, false); messageHandler(payload, false);
overrideHandler_ = nullptr; overrideHandler_ = nullptr;
} else if (messageHandler_) { } else if (messageHandler_) {
messageHandler(payload); messageHandler_(payload);
} }
} catch (winrt::hresult_error const& ex) { } catch (winrt::hresult_error const& ex) {
// winrt::Windows::Web::WebErrorStatus webErrorStatus{ // winrt::Windows::Web::WebErrorStatus webErrorStatus{
@@ -291,7 +288,7 @@ void FlipperReactSocketClient::OnWebSocketClosed(
return; return;
} }
status_ = Status::Closed; status_ = Status::Closed;
eventHandler(SocketEvent::CLOSE); eventHandler_(SocketEvent::CLOSE);
} }
} // namespace flipper } // namespace flipper