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

feat: disable URL state sync feature when running in datasette-lite #30

Merged

Conversation

hydrosquall
Copy link
Owner

Motivation

  • Currently, users break their shareable links when using this plugin inside of datasette lite since the plugin and the host application are both trying to store information in URL state. This shareable links feature is only intended to be used when not in the datasette lite environment.
  • This is a partial fix for feat: disable URL state sync option when running in datasette-lite #29
    • (Full fix would also require a fix upstream to change the behavior of the buttons for applying filters).

Changes

  • Add a prop that can control whether app state is stored in the URL hash, and toggle its value based on whether the datasette lite global is on the window.

Testing

  • Tested in the local sandbox with

    yarn run dev

Confirmed that after toggling the value of the global boolean, state would either be autosync'd to URL hash, or ignored. Component continued to work when state was maintained internally.

@hydrosquall hydrosquall self-assigned this Oct 18, 2022
@hydrosquall hydrosquall merged commit 42fdcd6 into main Oct 18, 2022
@hydrosquall hydrosquall deleted the cameron.yick/feature/disable-url-syncing-in-datasette branch October 18, 2022 23:48
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.

1 participant