Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #91 from rsml/issue-87-setShortcutItems-background…
Browse files Browse the repository at this point in the history
…-thread

Fix setShortcutItems UI API called on a background thread (#87)
  • Loading branch information
jordanbyron authored Nov 24, 2019
2 parents a64656a + 3fe6a9e commit 933b195
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RNQuickAction/RNQuickAction/RNQuickActionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ - (NSArray*)dynamicShortcutItemsForPassedArray:(NSArray*)passedArray {

RCT_EXPORT_METHOD(setShortcutItems:(NSArray *) shortcutItems)
{
dispatch_async(dispatch_get_main_queue(), ^{
NSArray *dynamicShortcuts = [self dynamicShortcutItemsForPassedArray:shortcutItems];
[UIApplication sharedApplication].shortcutItems = dynamicShortcuts;
});
}

RCT_EXPORT_METHOD(isSupported:(RCTResponseSenderBlock)callback)
Expand Down

0 comments on commit 933b195

Please sign in to comment.