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: ensure that shared content loads correctly under the basic model, fix bug introduced by PR: #169 #171

Merged

Conversation

HashCookie
Copy link
Contributor

@HashCookie HashCookie commented Nov 29, 2024

Fix bug introduced by PR: #169

Description:

When users modify content while using the basic(ACL) model and generate a share link, there is an issue where the content does not update when opening this link.

Reason:

In the original code, useEffect only depends on modelKind. If the shared content uses the basic modelKind, it will not trigger an update of useEffect, resulting in the data for enforceContext being unable to be passed through the sharing link.

Resolve:

Add a triggerUpdate state counter and include it in the useEffect dependencies to force content updates.

Copy link

netlify bot commented Nov 29, 2024

Deploy Preview for casbin-editor ready!

Name Link
🔨 Latest commit 7e316dd
🔍 Latest deploy log https://app.netlify.com/sites/casbin-editor/deploys/6749d0e7a3b786000855cf82
😎 Deploy Preview https://deploy-preview-171--casbin-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hsluoyz hsluoyz changed the title fix: ensure that shared content loads correctly under the basic model. fix: ensure that shared content loads correctly under the basic model, fix bug introduced by PR: #169 Nov 29, 2024
@hsluoyz hsluoyz merged commit 57aacb8 into casbin:master Nov 29, 2024
10 checks passed
@hsluoyz
Copy link
Member

hsluoyz commented Nov 29, 2024

🎉 This PR is included in version 1.25.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@HashCookie HashCookie deleted the share-content-sync-with-same-model branch January 4, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants