Fix dashboard embed fields
This commit is contained in:
parent
4dd3df5cc2
commit
88c4830209
@ -340,7 +340,7 @@ pub async fn get_reminders(id: u64, ctx: &State<Context>, pool: &State<Pool<MySq
|
||||
reminders.embed_image_url,
|
||||
reminders.embed_thumbnail_url,
|
||||
reminders.embed_title,
|
||||
reminders.embed_fields,
|
||||
IFNULL(reminders.embed_fields, '[]') AS embed_fields,
|
||||
reminders.enabled,
|
||||
reminders.expires,
|
||||
reminders.interval_seconds,
|
||||
|
@ -214,6 +214,7 @@ async function serialize_reminder(node, mode) {
|
||||
utc_time = luxon.DateTime.fromISO(
|
||||
node.querySelector('input[name="time"]').value
|
||||
).setZone("UTC");
|
||||
|
||||
if (utc_time.invalid) {
|
||||
return { error: "Time provided invalid." };
|
||||
} else {
|
||||
@ -368,7 +369,7 @@ function deserialize_reminder(reminder, frame, mode) {
|
||||
|
||||
const lastChild = frame.querySelector("div.embed-multifield-box .embed-field-box");
|
||||
|
||||
for (let field of reminder["embed_fields"]) {
|
||||
for (let field of reminder["embed_fields"] || []) {
|
||||
let embed_field = $embedFieldTemplate.content.cloneNode(true);
|
||||
embed_field.querySelector("textarea.discord-field-title").value = field["title"];
|
||||
embed_field.querySelector("textarea.discord-field-value").value = field["value"];
|
||||
|
Loading…
Reference in New Issue
Block a user