Skip to content

Commit

Permalink
fix(CellPreviewModal): fix opening preview for table with offset [#778]
Browse files Browse the repository at this point in the history
  • Loading branch information
Flunt1k committed Sep 20, 2024
1 parent 0b9356b commit 7347349
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import {
openCellPreview,
} from '../../modals/cell-preview';
import unipika from '../../../../common/thor/unipika';
import {getOffsetValue} from '../../../selectors/navigation/content/table';

export const showCellPreviewModal = (columnName: string, index: number): CellPreviewActionType => {
return async (dispatch, getState) => {
const path = getPath(getState());
const offset = getOffsetValue(getState());

const cellPath = `${path}{${columnName}}[#${index}:#${index + 1}]`;
const rowIndex = typeof offset === 'number' ? index + offset : index;

const cellPath = `${path}{${columnName}}[#${rowIndex}:#${rowIndex + 1}]`;

const ytCliDownloadCommand = `yt read-table '${cellPath}' --format json`;

Expand Down

0 comments on commit 7347349

Please sign in to comment.