Fix unresponsive edit message

A bug in the handling of custom data caused an error
that prevented the wizard from opening.
This commit is contained in:
Steven Nguyen
2024-02-08 16:00:21 -08:00
parent be09ddece1
commit b433fbf042
3 changed files with 6 additions and 3 deletions
@@ -56,7 +56,8 @@
$messageParams[$providerType] = {
...common,
title: '',
body: ''
body: '',
data: [['', '']]
};
break;
}
@@ -84,7 +84,9 @@
Object.entries(data['data'] ?? {}).forEach(([key, value]) => {
dataEntries.push([key, value.toString()]);
});
$messageParams[$providerType]['data'] = dataEntries || [['', '']];
$messageParams[$providerType]['data'] = dataEntries.length
? dataEntries
: [['', '']];
}
break;
}
@@ -54,7 +54,7 @@
let customData: [string, string][] = [];
onMount(() => {
$messageParams[MessagingProviderType.Push].data = customData || [['', '']];
customData = $messageParams[MessagingProviderType.Push].data;
});
async function sendTestMessage() {