Skip to content

Commit

Permalink
Fix react native windows (#4905)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #4905

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

Reviewed By: passy

Differential Revision: D47148297

fbshipit-source-id: bb2e81f62a65b9d4516a0bc4cfe2abddfc18a566
  • Loading branch information
lblasa authored and facebook-github-bot committed Jul 3, 2023
1 parent c067346 commit 54b7d8f
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,13 @@ void FlipperReactSocketClient::connect(FlipperConnectionManager* manager) {
try {
status_ = Status::Initializing;

Windows::Foundation::IAsyncAction ^ connectAction;
connectAction =
this->socket_.ConnectAsync(winrt::Windows::Foundation::Uri(uri));
connectAction->Completed = ref new AsyncActionCompletedHandler(
[eventHandler = eventHandler_](
Windows::Foundation::IAsyncAction ^ asyncAction,
Windows::Foundation::AsyncStatus asyncStatus) {
if (asyncStatus == Windows::Foundation::AsyncStatus::Completed) {
eventHandler(SocketEvent::OPEN);
this->socket_.ConnectAsync(winrt::Windows::Foundation::Uri(uri))
.Completed([&](auto&& asyncInfo, auto&& asyncStatus) {
if (asyncStatus ==
winrt::Windows::Foundation::AsyncStatus::Completed) {
eventHandler_(SocketEvent::OPEN);
} else {
eventHandler(SocketEvent::ERROR);
eventHandler_(SocketEvent::ERROR);
}
});

Expand All @@ -198,7 +194,7 @@ void FlipperReactSocketClient::connect(FlipperConnectionManager* manager) {
ex.to_abi())};
socket_ = nullptr;
status_ = Status::Unconnected;
eventHandler(SocketEvent::ERROR);
eventHandler_(SocketEvent::ERROR);
}
}

Expand Down Expand Up @@ -273,10 +269,11 @@ void FlipperReactSocketClient::OnWebSocketMessageReceived(
const std::string payload = winrt::to_string(message);

if (overrideHandler_ != nullptr) {
auto messageHandler = *overrideHandler_;
messageHandler(payload, false);
overrideHandler_ = nullptr;
} else if (messageHandler_) {
messageHandler(payload);
messageHandler_(payload);
}
} catch (winrt::hresult_error const& ex) {
// winrt::Windows::Web::WebErrorStatus webErrorStatus{
Expand All @@ -291,7 +288,7 @@ void FlipperReactSocketClient::OnWebSocketClosed(
return;
}
status_ = Status::Closed;
eventHandler(SocketEvent::CLOSE);
eventHandler_(SocketEvent::CLOSE);
}

} // namespace flipper
Expand Down

0 comments on commit 54b7d8f

Please sign in to comment.