Skip to content

Commit

Permalink
fix: cell edit doesn't properly use primary or unique index to update…
Browse files Browse the repository at this point in the history
… if both present, closes #51
  • Loading branch information
Fabio286 committed Apr 8, 2021
1 parent d374372 commit 55932fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/renderer/components/WorkspaceQueryTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ export default {
return this.getWorkspace(this.connUid).breadcrumbs.schema;
},
primaryField () {
const primaryFields = this.fields.filter(field => ['pri', 'uni'].includes(field.key));
const primaryFields = this.fields.filter(field => field.key === 'pri');
const uniqueFields = this.fields.filter(field => field.key === 'uni');
if (primaryFields.length > 1 || !primaryFields.length)
if ((primaryFields.length > 1 || !primaryFields.length) && (uniqueFields.length > 1 || !uniqueFields.length))
return false;
return primaryFields[0];
return primaryFields[0] || uniqueFields[0];
},
isSortable () {
return this.fields.every(field => field.name);
Expand Down

0 comments on commit 55932fe

Please sign in to comment.