fix: unwanted rerender when connect a new database (#127)

* deleted unused code

* fix: error when connect a new database

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml
This commit is contained in:
CorrectRoadH
2023-06-06 17:38:56 +08:00
committed by GitHub
parent 13606ab9df
commit 930279b2bd
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ const ConnectionSidebar = () => {
}, [selectedSchemaName, schemaList]);
useEffect(() => {
if (hasSchemaProperty && selectedSchemaName === "") {
if (hasSchemaProperty && selectedSchemaName === "" && schemaList.length > 0) {
conversationStore.updateSelectedSchemaName(head(schemaList)?.name || "");
}
}, [schemaList, currentConversation]);

View File

@ -42,7 +42,7 @@ const ConversationView = () => {
: [];
const lastMessage = last(messageList);
const [showSchemaDrawer, setShowSchemaDrawer] = useState<boolean>(false);
useEffect(() => {
messageStore.messageList.map((message: Message) => {
if (message.status === "LOADING") {