Console error when replace/delete files from past commit
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
When attempting to replace or delete file in a past commit, we've got an error in the console.
Current Behavior
- Errors occur when:
- Use the ref selector to open a file from a past commit
- Click history => Navigate back with browser back button
- OR Click blame => Navigate back with breadcrumb
- Or Click blame => Permalink
- Console errors appear && user sees a message about forking the project
Expected behaviour
There should not be console errors.
Implementation Plan
- We pass down
target_branch
fromblob_content_viewer
toblob_button_group
for delete (ref) and replace (ref) blob - In a nutshell, this check
on_top_of_branch
fails and we won't get a value from the helper. - Guard the check with optional chaining
- note, This behaviour weren't changed by the commit change blob work recently. I was able to verify by checking out this commit (prior to switching replace blob to the modal), it has the same behaviour.
Edited by 🤖 GitLab Bot 🤖