Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiya1155 committed Jan 16, 2024
1 parent 9e78450 commit e05b118
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 135 deletions.
8 changes: 6 additions & 2 deletions client/src/Project/CurrentTabContent/FileTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type Props = {
studioId?: string;
initialRanges?: [number, number][];
isFileInContext?: boolean;
isTemp?: boolean;
handleMoveToAnotherSide: () => void;
};

Expand All @@ -85,6 +86,7 @@ const FileTab = ({
studioId,
initialRanges,
isFileInContext,
isTemp,
}: Props) => {
const { t } = useTranslation();
const [file, setFile] = useState<FileResponse | null>(null);
Expand Down Expand Up @@ -246,8 +248,10 @@ const FileTab = ({
}, [repoRef, path]);

const handleClick = useCallback(() => {
updateTabProperty<FileTabType, 'isTemp'>(tabKey, 'isTemp', false, side);
}, [updateTabProperty, tabKey, side]);
if (isTemp) {
updateTabProperty<FileTabType, 'isTemp'>(tabKey, 'isTemp', false, side);
}
}, [updateTabProperty, tabKey, side, isTemp]);

const linesNumber = useMemo(() => {
return file?.contents?.split(/\n(?!$)/g).length || 0;
Expand Down
130 changes: 0 additions & 130 deletions client/src/components/Code/CodeFullSelectable/CodeLine.tsx

This file was deleted.

8 changes: 5 additions & 3 deletions client/src/components/Code/CodeLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ const CodeLine = ({

const handleMouseDown = useCallback(
(e: React.MouseEvent) => {
e.preventDefault();
if (!isSelectionDisabled && isEditingRanges) {
setIsDragging(true);
if (isEditingRanges) {
e.preventDefault();
if (!isSelectionDisabled) {
setIsDragging(true);
}
}
},
[isSelectionDisabled, isEditingRanges],
Expand Down

0 comments on commit e05b118

Please sign in to comment.