Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(macos): fix build break introduced in 2.5.13 #1527

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ PODS:
- React-jsi (= 0.71.26)
- React-logger (= 0.71.26)
- React-perflogger (= 0.71.26)
- ReactNativeHost (0.2.7):
- ReactNativeHost (0.2.8):
- React-Core
- React-cxxreact
- ReactCommon/turbomodule/core
Expand Down Expand Up @@ -499,7 +499,7 @@ SPEC CHECKSUMS:
React-RCTVibration: e6217ee1a90f98aab19888fa9326966250619030
React-runtimeexecutor: 332a0a638d7fed64b7e94475f802e7549132e06b
ReactCommon: 4d2b2c80862b5d12183dee271d5ced9082949354
ReactNativeHost: 5dd0021c01ade845f1171f4e6f6814f214ddfadb
ReactNativeHost: 5caf8c9381f26c453fabbe8c3b87f6a013a3c459
ReactTestApp-DevSupport: 5fd0815a03f06e26b120ac7b8a7ff29824fa700b
ReactTestApp-Resources: 8539dac0f8d2ef3821827a537e37812104c6ff78
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Expand Down
30 changes: 16 additions & 14 deletions macos/ReactTestApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

@IBAction
func onRememberLastComponentSelected(_ menuItem: NSMenuItem) {
switch menuItem.state {
case .mixed, .on:
Session.shouldRememberLastComponent = false
menuItem.state = .off
case .off:
Session.shouldRememberLastComponent = true
menuItem.state = .on
default:
assertionFailure()
}
onRememberLastComponentSelectedInternal(menuItem)
}

// MARK: Private
Expand Down Expand Up @@ -204,6 +195,19 @@ extension AppDelegate {
rememberLastComponentMenuItem.isEnabled = components.count > 1
}

private func onRememberLastComponentSelectedInternal(_ menuItem: NSMenuItem) {
switch menuItem.state {
case .mixed, .on:
Session.shouldRememberLastComponent = false
menuItem.state = .off
case .off:
Session.shouldRememberLastComponent = true
menuItem.state = .on
default:
assertionFailure()
}
}

private func present(_ component: Component) {
guard let window = mainWindow,
let host = reactInstance.host
Expand Down Expand Up @@ -300,13 +304,11 @@ extension AppDelegate {
window.contentViewController?.view = rootView

#if DEBUG
if Session.shouldRememberLastComponent {
rememberLastComponentMenuItem.state = .on
}

showReactMenu()
#endif // DEBUG
}

private func onRememberLastComponentSelectedInternal(_: NSMenuItem) {}
tido64 marked this conversation as resolved.
Show resolved Hide resolved
}

#endif // ENABLE_SINGLE_APP_MODE
Expand Down