Skip to content

Commit f15428c

Browse files
fix: added check to prevent unnecessary extra db calls
1 parent 958a352 commit f15428c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/desktop/src/routes/_protected/-components/connections-list.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function ConnectionCard({
5050
onSuccess: (data) => {
5151
const version = data[0]?.version
5252

53-
if (version) {
53+
if (version && version !== connection.version) {
5454
connectionsCollection.update([connection.id], (drafts) => {
5555
const draft = drafts[0]
5656

@@ -60,6 +60,9 @@ function ConnectionCard({
6060
})
6161
toast.success('Database version updated')
6262
}
63+
else if (version === connection.version) {
64+
toast.success('Database version is already up to date')
65+
}
6366
},
6467
onError: () => {
6568
toast.error('Failed to update database version')

0 commit comments

Comments
 (0)