mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(gh): properly handly pending requests
This commit is contained in:
parent
cd0d6fe864
commit
7a15e16d01
4 changed files with 5 additions and 5 deletions
|
|
@ -464,6 +464,7 @@ function M.comments(item, cb)
|
|||
state
|
||||
commit { oid }
|
||||
submittedAt
|
||||
createdAt
|
||||
reactionGroups {
|
||||
content
|
||||
users { totalCount }
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ function M:update(data, fields)
|
|||
vim.tbl_map(fix, item.comments or {})
|
||||
for _, review in ipairs(item.reviews or {}) do
|
||||
fix(review)
|
||||
review.created = review.submitted
|
||||
vim.tbl_map(fix, review.comments or {})
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -302,13 +302,12 @@ function M.render(buf, item, opts)
|
|||
for _, thread in ipairs(threads) do
|
||||
local c = #lines
|
||||
|
||||
if thread.submitted then
|
||||
ctx.is_review = thread.state ~= nil
|
||||
if ctx.is_review then
|
||||
---@cast thread snacks.gh.Review
|
||||
ctx.is_review = true
|
||||
vim.list_extend(lines, M.review(thread, ctx))
|
||||
else
|
||||
---@cast thread snacks.gh.Comment
|
||||
ctx.is_review = false
|
||||
vim.list_extend(lines, M.comment(thread, ctx))
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@
|
|||
---@field author snacks.gh.User
|
||||
---@field authorAssociation string
|
||||
---@field body string
|
||||
---@field createdAt string
|
||||
---@field submittedAt string
|
||||
---@field submitted number
|
||||
---@field created number
|
||||
|
|
@ -108,7 +109,7 @@
|
|||
---@field commit? {oid: string}
|
||||
---@field comments? snacks.gh.Comment[]
|
||||
|
||||
---@alias snacks.gh.Thread snacks.gh.Comment|snacks.gh.Review|{created: number}
|
||||
---@alias snacks.gh.Thread snacks.gh.Comment|snacks.gh.Review
|
||||
|
||||
---@class snacks.gh.Item
|
||||
---@field number number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue