Skip to content

Commit

Permalink
fix: cell update soft reload doesn't apply changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Sep 14, 2020
1 parent 78965d2 commit 1b04b21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/renderer/components/WorkspaceQueryTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,13 @@ export default {
}
},
applyUpdate (params) {
const { primary, id, field, content } = params;
const { primary, id, field, table, content } = params;
this.localResults = this.localResults.map(row => {
if (row[primary] === id)
if (row[primary] === id)// only fieldName
row[field] = content;
else if (row[`${table}.${primary}`] === id)// table.fieldName
row[`${table}.${field}`] = content;
return row;
});
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/components/WorkspaceTableTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
v-if="results"
v-show="!isQuering"
ref="queryTable"
:results="[results]"
:results="results"
:tab-uid="tabUid"
@update-field="updateField"
@delete-selected="deleteSelected"
Expand Down Expand Up @@ -72,7 +72,7 @@ export default {
return {
tabUid: 'data',
isQuering: false,
results: {},
results: [],
fields: [],
keyUsage: [],
lastTable: null,
Expand Down Expand Up @@ -116,7 +116,7 @@ export default {
async getTableData () {
if (!this.table) return;
this.isQuering = true;
this.results = {};
this.results = [];
const fieldsArr = [];
const keysArr = [];
this.setTabFields({ cUid: this.connection.uid, tUid: this.tabUid, fields: [] });
Expand Down Expand Up @@ -144,7 +144,7 @@ export default {
const { status, response } = await Tables.getTableData(params);
if (status === 'success')
this.results = response;
this.results = [response];
else
this.addNotification({ status: 'error', message: response });
}
Expand Down

0 comments on commit 1b04b21

Please sign in to comment.