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 crash when changing os theme kind #5354

Merged
merged 2 commits into from
May 11, 2022
Merged

Conversation

Nokel81
Copy link
Collaborator

@Nokel81 Nokel81 commented May 9, 2022

Signed-off-by: Sebastian Malton sebastian@malton.name

fixes #5171

Signed-off-by: Sebastian Malton <sebastian@malton.name>
@Nokel81 Nokel81 added the bug Something isn't working label May 9, 2022
@Nokel81 Nokel81 added this to the 5.5.0 milestone May 9, 2022
@Nokel81 Nokel81 requested a review from a team as a code owner May 9, 2022 20:15
@Nokel81 Nokel81 requested review from jansav, jim-docker and aleksfront and removed request for a team May 9, 2022 20:15
bindNativeThemeUpdateEvent() {
ipcRenderer.on(setNativeThemeChannel, (event, theme: "dark" | "light") => {
this.osNativeTheme = theme;
this.applyTheme(theme);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call was the main source of the crash because it treated "dark" as a ThemeId

Signed-off-by: Sebastian Malton <sebastian@malton.name>
@Nokel81
Copy link
Collaborator Author

Nokel81 commented May 10, 2022

To reproduce the crash, delete your OpenLens's lens-user-store.json file and then start make dev, once it starts and the window is open go to System Settings and switch your theme preference. On master this will crash the application.

Copy link
Contributor

@aleksfront aleksfront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nokel81 Nokel81 merged commit 42e7daf into master May 11, 2022
@Nokel81 Nokel81 deleted the fix-change-os-theme-crash branch May 11, 2022 13:07
@jim-docker jim-docker mentioned this pull request May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when switching OS theme
3 participants