We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the PR review UI, when I switch to a newly added file , octo will complains Error fetching <file_name>".
Error fetching <file_name>"
The following patch fixes the issue for me. I'd be happy to submit a PR if the fix looks good to you.
diff --git a/lua/octo/reviews/file-entry.lua b/lua/octo/reviews/file-entry.lua index 1058602..70f8920 100644 --- a/lua/octo/reviews/file-entry.lua +++ b/lua/octo/reviews/file-entry.lua @@ -77,7 +77,9 @@ function FileEntry:new(opt) left_binary = opt.left_binary, right_binary = opt.right_binary, left_lines = {}, + left_fetched = false, right_lines = {}, + right_fetched = false, diffhunks = diffhunks, associated_bufs = {}, viewed_state = pr.files[opt.path], @@ -205,10 +207,12 @@ function FileEntry:fetch() if self.pull_request.local_right then utils.get_file_at_commit(right_path, right_sha, function(lines) self.right_lines = lines + self.right_fetched = true end) else utils.get_file_contents(self.pull_request.repo, right_abbrev, right_path, function(lines) self.right_lines = lines + self.right_fetched = true end) end @@ -216,10 +220,12 @@ function FileEntry:fetch() if self.pull_request.local_left then utils.get_file_at_commit(left_path, left_sha, function(lines) self.left_lines = lines + self.left_fetched = true end) else utils.get_file_contents(self.pull_request.repo, left_abbrev, left_path, function(lines) self.left_lines = lines + self.left_fetched = true end) end @@ -232,7 +238,7 @@ end ---Determines whether the file content has been loaded and the file is ready to render ---@return boolean function FileEntry:is_ready_to_render() - return #self.left_lines > 0 and #self.right_lines > 0 + return self.left_fetched and self.right_fetched end ---Load the buffers.
The text was updated successfully, but these errors were encountered:
A PR would be appreciated! Good catch
Sorry, something went wrong.
Here we go #822
Successfully merging a pull request may close this issue.
In the PR review UI, when I switch to a newly added file , octo will complains
Error fetching <file_name>"
.The following patch fixes the issue for me. I'd be happy to submit a PR if the fix looks good to you.
The text was updated successfully, but these errors were encountered: