lobe-chat icon indicating copy to clipboard operation
lobe-chat copied to clipboard

🐛 fix: Bind the selected group name in the rename modal.

Open ramu-narasinga opened this issue 2 months ago • 3 comments

💻 变更类型 | Change Type

  • [ ] ✨ feat
  • [x] 🐛 fix
  • [ ] ♻️ refactor
  • [ ] 💄 style
  • [ ] 👷 build
  • [ ] ⚡️ perf
  • [ ] 📝 docs
  • [ ] 🔨 chore

🔀 变更说明 | Description of Change

Bind the selected group name in the rename group modal. The issue was that when there is multiple groups with sessions and you choose to rename a group, previously selected group name appears. Attached video.

📝 补充信息 | Additional Information

  1. Added useEffect dependent on group and then updated the setInput so that group.name fetched from the store is set in input.
 useEffect(() => {
    setInput(group?.name);
  }, [group]);
Before fix:

https://github.com/user-attachments/assets/402b3d08-62f6-485b-b2b7-e65b2dedfa67

After fix:

https://github.com/user-attachments/assets/a6ee0de4-d91f-4510-9395-2b7a8f88de48

ramu-narasinga avatar Dec 23 '24 21:12 ramu-narasinga