Skip to content

Commit

Permalink
update amount on bar fix, warning fix
Browse files Browse the repository at this point in the history
  • Loading branch information
emnbdx committed Sep 5, 2024
1 parent 78cde63 commit faa8277
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ function fetchDonation() {
request.onload = () => {
if (request.status === 200) {
const json = JSON.parse(request.response);
if (document.querySelector('.widget-donation-goal'))
window.currentAmount = json.amount;
window.continuationToken = json.continuationToken;

if (document.querySelector('.progress'))
updateDonationBar();
if (document.querySelector('.widget-alert-box') && json.donations && json.donations.length > 0)
json.donations.forEach(donation => {
displayAlertBox(donation.pseudo, donation.message, donation.amount);
});

window.currentAmount = json.amount;
window.continuationToken = json.continuationToken;
}
else {
console.error('Erreur lors de la récupération des données de donation:', request.response);
Expand Down
2 changes: 1 addition & 1 deletion js/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions widget_alert_box.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
}

// Initialisation des valeurs de départ
$image = htmlspecialchars($alertBoxWidget['image']);
$image = htmlspecialchars($alertBoxWidget['image'] ?? '');
$alert_duration = (int) $alertBoxWidget['alert_duration'];
$message_template = htmlspecialchars($alertBoxWidget['message_template']);
$sound = htmlspecialchars($alertBoxWidget['sound']);
$sound = htmlspecialchars($alertBoxWidget['sound'] ?? '');
$sound_volume = (int) $alertBoxWidget['sound_volume'];

?>
Expand Down

0 comments on commit faa8277

Please sign in to comment.