Fix sharing condition

This commit is contained in:
Andreas Nedbal 2023-10-16 19:38:20 +02:00 committed by Andreas Nedbal
parent 0f0f3ae0c6
commit 87813d3005
1 changed files with 5 additions and 5 deletions

View File

@ -30,15 +30,15 @@ export function answerEntryHandler(event: Event): void {
updateDeleteButton(false);
showNotification(data.message);
const sharing = inboxEntry.querySelector<HTMLElement>('.inbox-entry__sharing');
if (sharing != null) {
sharing.dataset.inboxSharingConfigValue = JSON.stringify(data.sharing);
}
const shareButton = inboxEntry.querySelector<HTMLButtonElement>('[data-controller="share"]');
if (shareButton != null) {
shareButton.dataset.shareTextValue = decodeURIComponent(data.sharing.custom).replaceAll('+', ' ');
}
const sharing = inboxEntry.querySelector<HTMLElement>('.inbox-entry__sharing');
if (sharing != null) {
sharing.dataset.inboxSharingConfigValue = JSON.stringify(data.sharing);
}
else {
(inboxEntry as HTMLElement).remove();
}