Skip to content

Commit

Permalink
Repopulate data only once on submit
Browse files Browse the repository at this point in the history
  • Loading branch information
CannonLock committed Jan 19, 2024
1 parent 59ea06a commit ba6a1ea
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/pages/maps/@id/edit/edit-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ export default function TableInterface({ url }: EditTableProps) {

const setTableUpdates = useCallback(async (newTableUpdates: TableUpdate[]) => {

// If the table updates are empty, reset the data
if (newTableUpdates.length == 0) {
let newData = await getData(newTableUpdates, dataParameters)
setData(newData)
}

// If a new update is available apply it to the data
if(newTableUpdates.length > tableUpdates.length){
let newData = applyTableUpdate(data, newTableUpdates.slice(-1)[0])
Expand Down Expand Up @@ -351,8 +345,6 @@ export default function TableInterface({ url }: EditTableProps) {
backgroundColor: filter.is_valid() || dataParameters?.group == columnName ? "rgba(27,187,255,0.12)" : "#ffffff00"
}
}, [])

console.log(dataParameters)
}, [dataParameters, data, visibleColumnNames])

const rowHeaderCellRenderer = useCallback((rowIndex: number) => {
Expand Down Expand Up @@ -494,7 +486,6 @@ export default function TableInterface({ url }: EditTableProps) {
rowHeaderCellRenderer: rowHeaderCellRenderer,
onFocusedCell: (focusedCellCoordinates) => {
try {
console.log(ref.current[focusedCell?.col][focusedCell?.row])
ref.current[focusedCellCoordinates?.row][focusedCellCoordinates?.col]?.focus()
} catch (e) {}

Expand All @@ -504,7 +495,6 @@ export default function TableInterface({ url }: EditTableProps) {
focusedCell: focusedCell,
onPaste: (clipboardData, rowIndex, columnIndex) => {
const pastedText = clipboardData.getData("text/plain")
console.log(pastedText, ":", rowIndex, ",", columnIndex)
},
onSelection: (selections: Selection[]) => {
const selectedColumnRange = selections[0]?.cols
Expand Down

0 comments on commit ba6a1ea

Please sign in to comment.