Skip to content

Commit d96a4ba

Browse files
Dave Millerfacebook-github-bot-7
authored andcommitted
Minor fixes to clipboard and Linking to remove TODOs
Reviewed By: nicklockwood Differential Revision: D2921782 fb-gh-sync-id: e387b720421ed6ed03a50633d71e08791f87c761 shipit-source-id: e387b720421ed6ed03a50633d71e08791f87c761
1 parent ab09ff5 commit d96a4ba

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Libraries/LinkingIOS/RCTLinkingManager.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ - (void)handleOpenURLNotification:(NSNotification *)notification
7777
resolve:(RCTPromiseResolveBlock)resolve
7878
reject:(__unused RCTPromiseRejectBlock)reject)
7979
{
80-
// TODO: we should really report success/failure via the promise here
81-
// Doesn't really matter what thread we call this on since it exits the app
82-
[RCTSharedApplication() openURL:URL];
83-
resolve(@YES);
80+
BOOL opened = [RCTSharedApplication() openURL:URL];
81+
resolve(@(opened));
8482
}
8583

8684
RCT_EXPORT_METHOD(canOpenURL:(NSURL *)URL

React/Modules/RCTClipboard.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ - (dispatch_queue_t)methodQueue
2626
RCT_EXPORT_METHOD(setString:(NSString *)content)
2727
{
2828
UIPasteboard *clipboard = [UIPasteboard generalPasteboard];
29-
clipboard.string = content;
29+
clipboard.string = (content ? : @"");
3030
}
3131

3232
RCT_EXPORT_METHOD(getString:(RCTPromiseResolveBlock)resolve
3333
rejecter:(__unused RCTPromiseRejectBlock)reject)
3434
{
3535
UIPasteboard *clipboard = [UIPasteboard generalPasteboard];
36-
resolve(RCTNullIfNil(clipboard.string));
36+
resolve((clipboard.string ? : @""));
3737
}
3838

3939
@end

0 commit comments

Comments
 (0)