Skip to content

Commit

Permalink
Fix double clicking projects to open them (#7690)
Browse files Browse the repository at this point in the history
- Fixes #7689
- Fix double clicking projects to open them

# Important Notes
None
  • Loading branch information
somebody1234 authored Sep 5, 2023
1 parent 82f634b commit abdbcfc
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export default function ProjectNameColumn(props: ProjectNameColumnProps) {
backend.type === backendModule.BackendType.local ||
(ownPermission != null &&
backendModule.PERMISSION_ACTION_CAN_EXECUTE[ownPermission.permission])
const isOtherUserUsingProject = asset.projectState.opened_by !== organization?.email
const isOtherUserUsingProject =
backend.type !== backendModule.BackendType.local &&
asset.projectState.opened_by != null &&
asset.projectState.opened_by !== organization?.email

const doRename = async (newName: string) => {
try {
Expand Down Expand Up @@ -220,8 +223,8 @@ export default function ProjectNameColumn(props: ProjectNameColumnProps) {
item.depth
)}`}
onClick={event => {
if (isRunning || rowState.isEditingName || isOtherUserUsingProject) {
// The project should not be edited in these cases.
if (rowState.isEditingName || isOtherUserUsingProject) {
// The project should neither be edited nor opened in these cases.
} else if (eventModule.isDoubleClick(event)) {
// It is a double click; open the project.
dispatchAssetEvent({
Expand All @@ -230,6 +233,7 @@ export default function ProjectNameColumn(props: ProjectNameColumnProps) {
shouldAutomaticallySwitchPage: true,
})
} else if (
!isRunning &&
eventModule.isSingleClick(event) &&
(selected ||
shortcuts.matchesMouseAction(shortcutsModule.MouseAction.editName, event))
Expand Down

0 comments on commit abdbcfc

Please sign in to comment.