Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES];
self->_window.releasedWhenClosed = NO;
self->_window.backgroundColor = [NSColor clearColor];

NSTextField *label = [[NSTextField alloc] initWithFrame:self->_window.contentView.bounds];
label.font = [NSFont monospacedDigitSystemFontOfSize:12.0 weight:NSFontWeightRegular];
label.alignment = NSTextAlignmentCenter;
label.bezeled = NO;
label.editable = NO;
Expand All @@ -169,7 +169,11 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
self->_label.textColor = color;

self->_label.backgroundColor = backgroundColor;
[RCTKeyWindow() beginSheet:self->_window completionHandler:nil];
if (![[RCTKeyWindow() sheets] doesContain:self->_window]) {
[RCTKeyWindow() beginSheet:self->_window completionHandler:^(NSModalResponse returnCode) {
[self->_window orderOut:self];
}];
}
#endif // macOS]
});

Expand Down
Loading