Skip to content

Commit

Permalink
Fixed bug with toasts JS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tomik-z-cech committed Feb 24, 2024
1 parent 99a7734 commit 4a52421
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@
{% block extra_js %}
<!-- Toasts -->
<script type="text/javascript">
let newToast = new bootstrap.Toast($('.toast'));
newToast.show();
$(document).ready(function() {
let newToast = new bootstrap.Toast($('.toast'));
if ($('.toast').length > 0) {
newToast.show();
};
});
</script>
{% endblock %}
</body>
Expand Down

0 comments on commit 4a52421

Please sign in to comment.