╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │208 .author = author, │ │209 .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()), │ │210 }); │ │211 +} │ │212 + │ │213 +pub fn removeDraft(session: *ui.Session, allocator: std.mem.Allocator, id: *const [evt.event_id_size]u8) !void {│ │214 + const io = session.io orelse return error.NotFound; │ │215 + const repos_dir = session.repos_dir orelse return error.NotFound; │ │216 + const admin_repo = session.admin_repo orelse return error.NotFound; │ │217 + const user_id_slice = session.data.user_id orelse return error.NotFound; │ │218 + if (user_id_slice.len != evt.event_id_size) return error.NotFound; │ │219 + const author = (try session.eventAuthor()) orelse return error.NotFound; │ │220 + │ │221 + var user_id: [evt.event_id_size]u8 = undefined; │ │222 + @memcpy(&user_id, user_id_slice); │ │223 + const id_hex = std.fmt.bytesToHex(id.*, .lower); │ │224 + try fork.remove(io, allocator, repos_dir, admin_repo, &id_hex, &user_id, author); │ │225 } │ │226 │ │227 // `status`'s windowed listing. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │330 } │ │331 }; │ │332 empty.drafts = drafts_window; │ │319 - if (draft_selected) empty.view = .drafts; │ │333 + if (draft_selected and view != .remove) empty.view = .drafts; │ │334 │ │335 // an explicitly named posted patch that doesn't exist is a bad url │ │336 // (NotFound -> 404); drafts, tags, and bare routes can use the empty fallback.│ ╰────────────────────────────────────────────────────────────────────────────────────────╯