This commit is contained in:
sent 2025-04-17 09:27:26 -07:00
parent cc6ecc1188
commit c399f5003e

View File

@ -9,10 +9,17 @@ document.addEventListener('DOMContentLoaded', () => {
const erudaLoadingScreen = document.getElementById('erudaLoadingScreen'); const erudaLoadingScreen = document.getElementById('erudaLoadingScreen');
if (!refreshIcon || !fullscreenIcon || !backIcon || !forwardIcon || !iframe) return; if (!refreshIcon || !fullscreenIcon || !backIcon || !forwardIcon || !iframe) return;
let loadingHidden = false; let loadingHidden = false;
let hideTimeout;
function showLoadingScreen(withToast = true, showEruda = false) { function showLoadingScreen(withToast = true, showEruda = false) {
clearTimeout(hideTimeout)
loadingHidden = false; loadingHidden = false;
NProgress.start(); NProgress.start();
hideTimeout = setTimeout(() => {
hideLoadingScreen();
}, 15000);
if (withToast) { if (withToast) {
showToast( showToast(
'Consider joining our <a href="https://discord.gg/dJvdkPRheV" target="_blank" class="hover-link">Discord</a>&nbsp;<3', 'Consider joining our <a href="https://discord.gg/dJvdkPRheV" target="_blank" class="hover-link">Discord</a>&nbsp;<3',
@ -24,6 +31,7 @@ document.addEventListener('DOMContentLoaded', () => {
function hideLoadingScreen() { function hideLoadingScreen() {
if (loadingHidden) return; if (loadingHidden) return;
clearTimeout(hideTimeout)
loadingHidden = true; loadingHidden = true;
NProgress.done(); NProgress.done();
} }
@ -246,7 +254,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (u.hostname.includes('.')) return u.toString(); if (u.hostname.includes('.')) return u.toString();
} catch {} } catch {}
} }
return `https://search.brave.com/search?q=${encodeURIComponent(query)}`; return `https://duckduckgo.com/search?q=${encodeURIComponent(query)}&ia=web`;
} }
function showToast(message, type = 'success', iconType = 'check') { function showToast(message, type = 'success', iconType = 'check') {