-
Notifications
You must be signed in to change notification settings - Fork 235
fix: ensure tag list updates immediately after editing #10577
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
base: dev/7.4.x
Are you sure you want to change the base?
Conversation
| await apiPost('/tags.update', updateTagsData); | ||
| if (pageId != null) { | ||
| await mutate(key => JSON.stringify(key).includes(pageId), undefined, { revalidate: true }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- これだと何が mutate されているか分かりにくいです
- String.prototype.includes() だと意図しないキーがマッチして無駄な再検証が走る可能性があります (本来やりたいことは tag の再検証のみ)
- useSWRxTagsInfo から提供される mutate を使って実装してみてほしいです
- updateStateAfterSave の中に mutate に実装しても良さそうです
52b6953 to
8405d83
Compare
| await apiPost('/tags.update', updateTagsData); | ||
| if (mutateTags != null) { | ||
| await mutateTags(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutateTags って nullable じゃなさそうなので null check は不要そう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あと、これは非同期でも良さそうなので await もいらないかも (更新が成功したら即時トースターをだしたいので)
https://redmine.weseek.co.jp/issues/174438
2025-12-08.14-51-29.mp4