Skip to content

Conversation

tarinagarwal
Copy link

  • Fixed file exports to include correct theme data
  • Updated PNG and JPG exports to maintain currently selected theme
  • Fixed theme reverting to default on page reload
  • Ensures theme state persists across browser sessions and exports
2025-08-26.18-06-10.mp4

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
Copy link
Contributor

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 ok that save viewport, children, and theme to one place.

};

// Fallback theme background colors mapping
const getThemeBackgroundColorFallback = (
Copy link
Contributor

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) {
Copy link
Contributor

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
Copy link
Contributor

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.

@pubuzhixing8
Copy link
Contributor

pubuzhixing8 commented Aug 27, 2025

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.

@tarinagarwal
Copy link
Author

Hey! @pubuzhixing8
Yeah, I am working on that, will create the PR ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants