Skip to content
Permalink
Browse files

Update loading pre-bundled message

Summary:
Updated the message from

> Loading from pre-bundled file

to

> Connect to Metro to develop JavaScript

I also added a new RCT_PACKAGER_NAME so other packagers can override "Metro"

Reviewed By: yungsters, cpojer

Differential Revision: D16427501

fbshipit-source-id: 1b7f9e261f7521ba930c6248087fe6f3c3659cb7
  • Loading branch information...
rickhanlonii authored and facebook-github-bot committed Aug 7, 2019
1 parent 2e8ecab commit eb92f8181f3119bbc69ff7cb5aff2e03d993b8b3
Showing with 12 additions and 5 deletions.
  1. +7 −0 React/Base/RCTDefines.h
  2. +5 −5 React/DevSupport/RCTDevLoadingView.m
@@ -89,6 +89,13 @@
#endif
#endif

/**
* Add the default packager name
*/
#ifndef RCT_PACKAGER_NAME
#define RCT_PACKAGER_NAME @"Metro"
#endif

/**
* By default, only raise an NSAssertion in debug mode
* (custom assert functions will still be called).
@@ -130,22 +130,22 @@ - (void)showWithURL:(NSURL *)URL
{
UIColor *color;
UIColor *backgroundColor;
NSString *source;
NSString *message;
if (URL.fileURL) {
// If dev mode is not enabled, we don't want to show this kind of notification
#if !RCT_DEV
return;
#endif
color = [UIColor grayColor];
color = [UIColor whiteColor];
backgroundColor = [UIColor blackColor];
source = @"pre-bundled file";
message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME];
} else {
color = [UIColor whiteColor];
backgroundColor = [UIColor colorWithHue:1./3 saturation:1 brightness:.35 alpha:1];
source = [NSString stringWithFormat:@"%@:%@", URL.host, URL.port];
message = [NSString stringWithFormat:@"Loading from %@:%@...", URL.host, URL.port];
}

[self showMessage:[NSString stringWithFormat:@"Loading from %@...", source]
[self showMessage:message
color:color
backgroundColor:backgroundColor];
}

0 comments on commit eb92f81

Please sign in to comment.
You can’t perform that action at this time.