Skip to content

AISetting subscribes to the entire org store #2031

Description

@Aias00

Chat2DB Edition

Chat2DB Community

Chat2DB Version

5.3.0

Deployment

Web

Operating System

macOS

Operating System Version

12

Database and Version

No response

Problem Summary

In AISetting, const { curOrg } = useOrgStore(); destructures one field but subscribes to the entire org store, so the component re-renders on every org-store change instead of only when curOrg changes.

Steps to Reproduce

  1. Open the AI settings page.
  2. Trigger any unrelated org-store change.
  3. Observe the settings component re-renders unnecessarily.

Expected Behavior

Subscribe only to the needed field: const curOrg = useOrgStore((s) => s.curOrg);.

Actual Behavior

blocks/Setting/AISetting/index.tsx:24:

const { curOrg } = useOrgStore();

Logs

Screenshots or Additional Context

N/A

Impact

Limited or cosmetic impact

Workaround

N/A

Submission Checklist

  • I reproduced this on the selected Chat2DB edition.
  • I searched existing issues for duplicates.
  • I removed credentials and private data.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions