Skip to content

Conversation

@shalini-saloni
Copy link

Description

Fixes #752

This PR addresses two bugs:

  1. Settings reset on reload: SettingsContext was initializing state with defaults and only reading from localStorage in a useEffect, causing settings to be overwritten on every page load.
  2. Potential crash in utils: dataURItoBlob lacked error handling for malformed data URIs.

Changes

  • Initialize SettingsContext state lazily from localStorage to ensure settings are loaded before first render
  • Add error handling to dataURItoBlob in utils.js to handle invalid inputs gracefully

Testing

  • Verified settings now persist across page reloads
  • Tested dataURItoBlob with valid and invalid inputs

Fixes drawdb-io#752

- Initialize SettingsContext state lazily from localStorage to ensure
  settings are loaded before first render, preventing reset to defaults
- Add error handling to dataURItoBlob to handle invalid inputs gracefully
@vercel
Copy link

vercel bot commented Nov 30, 2025

@shalini-saloni is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Bug: Settings reset on reload & Potential crash in utils

1 participant