message_edit_history: Use raw_data and data more.

Prefer using `raw_data` and `data` instead of
`data` and `clean_data`.
This commit is contained in:
Varun Singh 2024-06-21 23:52:14 +05:30 committed by Tim Abbott
parent f553142c7c
commit 3d64fb6cda

View File

@ -115,12 +115,12 @@ export function fetch_and_render_message_history(message: Message): void {
void channel.get({
url: "/json/messages/" + message.id + "/history",
data: {message_id: JSON.stringify(message.id)},
success(data) {
const clean_data = server_message_history_schema.parse(data);
success(raw_data) {
const data = server_message_history_schema.parse(raw_data);
const content_edit_history: EditHistoryEntry[] = [];
let prev_stream_item: EditHistoryEntry | null = null;
for (const [index, msg] of clean_data.message_history.entries()) {
for (const [index, msg] of data.message_history.entries()) {
// Format times and dates nicely for display
const time = new Date(msg.timestamp * 1000);
const edited_at_time = timerender.get_full_datetime(time, "time");