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: apply initialData appState for zenmode and grid stats and refactor check param for actions #2871

Merged
merged 5 commits into from Jan 29, 2021

Conversation

ad1992
Copy link
Member

@ad1992 ad1992 commented Jan 28, 2021

fixes #2870

@vercel
Copy link

vercel bot commented Jan 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/qp2wkb3fc
✅ Preview: https://excalidraw-git-aakansha-fix.excalidraw.vercel.app

@ad1992 ad1992 requested a review from dwelle January 28, 2021 19:03
@dwelle
Copy link
Member

dwelle commented Jan 28, 2021

I'm facepalming myself — didn't think of state persistence.

That said, this fix won't do. Mixing action objects and functions returning action objects is introducing several problems: 1) it's not pretty 2) it's not performant (having to rebuild/register actions multiple times) 3) and since we don't type check the exported actions, it will be error prone. In fact, it already is: it breaks shortcut handling.

I propose we change checked from boolean to (appState) => boolean.

@ad1992 ad1992 changed the title fix: pass default value for grid mode & zen mode so it sets the value from initialData appState fix: apply initialData appState for zenmode and grid stats and refactor check param for actions Jan 29, 2021
@ad1992 ad1992 requested a review from lipis January 29, 2021 16:38
Copy link
Member

@dwelle dwelle left a comment

Choose a reason for hiding this comment

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

changelog?

@ad1992
Copy link
Member Author

ad1992 commented Jan 29, 2021

changelog?

@dwelle since we will anyways update the changelog as it's out of sync before we do the next version release so it will be easier to add at that time since this not an API change so the pr title can be used as it is in the changelog. (I pull all commits pushed after the last release and categorize it, will soon automate the categorizing then it will be easy to generate changelog).

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.

Context menu actions broken when set from initialData
3 participants