Skip to content

Commit

Permalink
Apply changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Anastasia Orishchenko committed Jul 27, 2020
1 parent 9bfcbe7 commit cb44909
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion windows/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
**/AppPackages/**
AppPackages/
x64/
x86/
build/
Expand Down
3 changes: 2 additions & 1 deletion windows/ReactTestApp/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ namespace winrt::ReactTestApp::implementation
}
}

IAsyncAction MainPage::OnNavigatedTo(NavigationEventArgs)
IAsyncAction MainPage::OnNavigatedTo(NavigationEventArgs const &e)
{
Base::OnNavigatedTo(e);
bool devServerIsRunning = co_await ::ReactTestApp::IsDevServerRunning();
if (devServerIsRunning) {
reactInstance_.LoadJSBundleFrom(::ReactTestApp::JSBundleSource::DevServer);
Expand Down
5 changes: 3 additions & 2 deletions windows/ReactTestApp/MainPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ namespace winrt::ReactTestApp::implementation
Windows::UI::Xaml::RoutedEventArgs);
void LoadFromDevServer(Windows::Foundation::IInspectable const &,
Windows::UI::Xaml::RoutedEventArgs);
winrt::Windows::Foundation::IAsyncAction
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs);
Windows::Foundation::IAsyncAction
OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e);
using Base = MainPageT;

private:
::ReactTestApp::ReactInstance reactInstance_;
Expand Down
4 changes: 1 addition & 3 deletions windows/ReactTestApp/ReactInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ using winrt::Windows::Web::Http::HttpClient;

namespace ReactTestApp
{

void ReactInstance::LoadJSBundleFrom(JSBundleSource source)
{
auto instanceSettings = reactNativeHost_.InstanceSettings();
Expand Down Expand Up @@ -55,14 +54,13 @@ namespace ReactTestApp
}
}

return ""; // TODO handle bundle not present
return "";
}

IAsyncOperation<bool> IsDevServerRunning()
{
Uri uri = Uri(L"http://localhost:8081/status");
HttpClient httpClient;
std::wstring httpResponseBody;
try {
auto r = co_await httpClient.GetAsync(uri);
co_return r.IsSuccessStatusCode();
Expand Down

0 comments on commit cb44909

Please sign in to comment.