use showToast in some areas where we weren't before

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-20 15:45:56 -05:00
parent 3c3950adb0
commit 5f16356d7a
2 changed files with 2 additions and 12 deletions

View File

@ -1,6 +1,5 @@
function poll_vote_no_v() {
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show();
showToast(false, "Only logged-in users can vote!");
}
function expandMarkdown(id,type) {

View File

@ -1,13 +1,8 @@
function block_user() {
var usernameField = document.getElementById("exile-username");
var isValidUsername = usernameField.checkValidity();
username = usernameField.value;
if (isValidUsername) {
const xhr = new XMLHttpRequest();
xhr.open("post", "/settings/block");
xhr.setRequestHeader('xhr', 'xhr');
@ -19,11 +14,7 @@ function block_user() {
location.reload();
}
else {
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success'));
myToast.hide();
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error'));
myToast.show();
document.getElementById("toast-error-message").textContent = "Error. Please try again later.";
showToast(false, "Error, please try again later.");
}
}
xhr.send(f)