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

Prevent local save in build #33

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

raphaelameaume
Copy link
Owner

Issue

When hitting Cmd+S in build mode, the screenshotCanvas() function would try to POST the dataURL to the unexisting dev server in order to save it on disk.

Summary
Allow the POST request only in a dev environment

Description

  • Added a __DEV__ global in the vite config
  • Encapsulates the POST request only if __DEV__ is true
  • Rename PRODUCTION global to __BUILD__ for better consistency between modes
  • Update docs for hiding props between modes
  • Added missing reject in createBlobFromDataURL, causing a type error instead of throwing the error needed for debugging.
@raphaelameaume raphaelameaume merged commit 9ba0beb into dev Oct 12, 2022
@raphaelameaume raphaelameaume deleted the bugfix/prevent-local-save-in-build branch October 12, 2022 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant