Left menu and chip links (#12294)
Small optimization for faster loading (gaining ~80ms - average time of a click) It might seem a little over-engineered but there are a lot of edge cases and I couldn't find a simpler solution I also tried to tackle Link Chips but it's more complex so this will be for another PR
This commit is contained in:
@ -18,7 +18,7 @@ import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { PREVIEWABLE_EXTENSIONS } from '@/activities/files/const/previewable-extensions.const';
|
||||
import { IconCalendar, OverflowingTextWithTooltip } from 'twenty-ui/display';
|
||||
import { isModifiedEvent } from 'twenty-ui/utilities';
|
||||
import { isNavigationModifierPressed } from 'twenty-ui/utilities';
|
||||
import { formatToHumanReadableDate } from '~/utils/date-utils';
|
||||
import { getFileNameAndExtension } from '~/utils/file/getFileNameAndExtension';
|
||||
|
||||
@ -141,7 +141,7 @@ export const AttachmentRow = ({
|
||||
|
||||
const handleOpenDocument = (e: React.MouseEvent) => {
|
||||
// Cmd/Ctrl+click opens new tab, right click opens context menu
|
||||
if (isModifiedEvent(e) || e.button === 2) {
|
||||
if (isNavigationModifierPressed(e) === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user