diff options
Diffstat (limited to 'app/helpers/tree_helper.rb')
-rw-r--r-- | app/helpers/tree_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index 7644ed783eb..1d8d9ddc1ec 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -199,14 +199,14 @@ module TreeHelper } end - def ide_base_path(project) + def web_ide_url_data(project) can_push_code = current_user&.can?(:push_code, project) fork_path = current_user&.fork_of(project)&.full_path - if can_push_code - project.full_path + if fork_path && !can_push_code + { path: fork_path, is_fork: true } else - fork_path || project.full_path + { path: project.full_path, is_fork: false } end end @@ -216,7 +216,7 @@ module TreeHelper show_web_ide_button = (can_collaborate || current_user&.already_forked?(project) || can_create_mr_from_fork) { - ide_base_path: ide_base_path(project), + web_ide_url_data: web_ide_url_data(project), needs_to_fork: !can_collaborate && !current_user&.already_forked?(project), show_web_ide_button: show_web_ide_button, show_gitpod_button: show_web_ide_button && Gitlab::Gitpod.feature_and_settings_enabled?(project), |