-
Notifications
You must be signed in to change notification settings - Fork 851
Fix theme persistence in exports and page reloads #235
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
base: develop
Are you sure you want to change the base?
Conversation
fix all file exports to have correct theme data fix png and jpg exports to persist current selected theme
}; | ||
setValue(newValue); | ||
|
||
// Only save children and viewport to localforage, not theme |
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.
I am curious that why not save theme to localforage and save it to localStorage.
I think is fine that save viewport, children, and theme to one place.
}; | ||
|
||
// Fallback theme background colors mapping | ||
const getThemeBackgroundColorFallback = ( |
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.
You can get the active themeColors data through PlaitBoard.getThemeColors(board);
.
You can encapsulate e method exactly to get the background color of the drawing board in this way.
children: data.children, | ||
viewport: data.viewport, | ||
theme: { themeColorMode: savedTheme || ThemeColorMode.default }, | ||
}); | ||
return; | ||
} | ||
const localData = localStorage.getItem(OLD_DRAWNIX_LOCAL_DATA_KEY); | ||
if (localData) { |
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.
I would like to remove the feedback logic later, so you can ignore it.
}} | ||
afterInit={(board) => { | ||
console.log('board initialized'); | ||
|
||
// Ensure the saved theme is applied after board initialization |
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.
If the theme could be initialized correctly, whether the logic maybe is unnecessary.
Hi @tarinagarwal ! I had reviewed this pr and there were some suggestions. You can resolve them in your free time. Btw, there is a conflict in app.tsx. |
Hey! @pubuzhixing8 |
@tarinagarwal Have you pushed it, I don't see any new commits. |
@pubuzhixing8 no i havent, ill push it today |
Hi @tarinagarwal, we set up a contributors group on Discord and are looking forward to your joining https://discord.gg/Dw55dMr8. |
@pubuzhixing8 Ya sure I will join it now! |
Congrats on the new flat! Don't even worry about the PR right now—you can tackle that after you've settled in. |
@pubuzhixing8 Thank you! |
@pubuzhixing8 Hey! Sorry for not being active.. I am done with all my shifting stuff. I will get done with all these fixes by tmrw! |
2025-08-26.18-06-10.mp4