-
Notifications
You must be signed in to change notification settings - Fork 400
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 acknow window #779
base: dev
Are you sure you want to change the base?
Fix acknow window #779
Conversation
// Acknowledgements window for macOS 15+ | ||
// Can't use else direct here since SceneBuilder does not implement it yet. | ||
// Fix issue "Closure containing control flow statement cannot be used with result builder 'SceneBuilder'" | ||
if #available(macOS 15.0, *) { | ||
// Acknowledgements window | ||
Window("setting.about.acknowledgements", id: .acknowledgementsWindowIdMacOS15Plus) { | ||
AcknowListView() | ||
} | ||
.windowToolbarStyle(.unifiedCompact) | ||
.defaultSize(width: 800, height: 600) | ||
.restorationBehavior(.disabled) | ||
} | ||
|
||
// Acknowledgements window for macOS 15-, cannot use #unavailable | ||
Window("setting.about.acknowledgements", id: .acknowledgementsWindowId) { | ||
AcknowListView() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is not good. I tried to improve it, but didn't succeed. I know this is to pass the compilation. This is a problem with SwiftUI.
It seems we have no way to control a view to only display on macOS 15 or below, which will cause both Acknowledgements windows to be executed, including AcknowListView.
rm -rf ~/Library/Saved\ Application\ State/com.izual.Easydict.savedState
If this solution works, I suggest we do not add this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we request the original issue creator to try the solution first. The window should not be saved in most cases. (That's explained why you and I both can't reproduce it.)
#767 (comment)