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: fix bug to prevent shared content from being overridden by example content #169

Merged
merged 3 commits into from
Nov 23, 2024

Conversation

HashCookie
Copy link
Contributor

fix: #166

Initial question:

First set the shared content
Then set up the model modelKind
modelKind change trigger useEffect
The code in useEffect overwrites the recently set shared content with the example content.

Resolved:

Temporarily save the shared content in ref.
Prioritize using shared content when modelKind changes.
Clear shared content after use to ensure that example content is used when the modelKind changes subsequently.

Copy link

netlify bot commented Nov 22, 2024

Deploy Preview for casbin-editor ready!

Name Link
🔨 Latest commit 9b2a00b
🔍 Latest deploy log https://app.netlify.com/sites/casbin-editor/deploys/6740bd9b47475d00085be539
😎 Deploy Preview https://deploy-preview-169--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: prevent shared content from being overridden by example content feat: fix bug to prevent shared content from being overridden by example content Nov 23, 2024
@hsluoyz hsluoyz merged commit ebeb4a2 into casbin:master Nov 23, 2024
10 checks passed
@hsluoyz
Copy link
Member

hsluoyz commented Nov 23, 2024

🎉 This PR is included in version 1.24.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

Shared Content not loading properly
2 participants