Skip to content

Commit

Permalink
Merge pull request #3909 from mathesar-foundation/3867_table_rename_b…
Browse files Browse the repository at this point in the history
…ug_2

Fix bug when updating table twice
  • Loading branch information
pavish authored Oct 2, 2024
2 parents a41e2fb + b16d380 commit be8bc92
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mathesar_ui/src/stores/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ function putTableInStore({
$tablesStore.databaseId === schema.database.id &&
$tablesStore.schemaOid === schema.oid
) {
tablesStore.update(({ requestStatus, tablesMap }) => {
tablesMap.set(fullTable.oid, fullTable);
tablesStore.update((tablesData) => {
tablesData.tablesMap.set(fullTable.oid, fullTable);
const newTablesMap = new Map(
sortTables(tablesMap.values()).map((t) => [t.oid, t]),
sortTables(tablesData.tablesMap.values()).map((t) => [t.oid, t]),
);
return {
requestStatus,
...tablesData,
tablesMap: newTablesMap,
};
});
Expand Down

0 comments on commit be8bc92

Please sign in to comment.