release(1.7.4): login hint replaced toast + fix unauth boot
This commit is contained in:
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Changes 10/31/2025 (v1.7.4)
|
||||||
|
|
||||||
|
release(1.7.4): login hint replace toast + fix unauth boot
|
||||||
|
|
||||||
|
main.js
|
||||||
|
|
||||||
|
- Added isDemoHost() and showLoginTip(message).
|
||||||
|
- In the unauth branch, call showLoginTip('Please log in to continue').
|
||||||
|
- Removed ensureToastReady() + showToast('please_log_in_to_continue') in the unauth path to avoid loading toast/DOM utils before auth.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Changes 10/31/2025 (v1.7.3)
|
## Changes 10/31/2025 (v1.7.3)
|
||||||
|
|
||||||
release(v1.7.3): lightweight boot pipeline, dramatically faster first paint, deduped /api writes, sturdier uploads/auth
|
release(v1.7.3): lightweight boot pipeline, dramatically faster first paint, deduped /api writes, sturdier uploads/auth
|
||||||
|
|||||||
@@ -61,6 +61,40 @@ async function ensureToastReady() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isDemoHost() {
|
||||||
|
// Handles optional "www." just in case
|
||||||
|
return location.hostname.replace(/^www\./, '') === 'demo.filerise.net';
|
||||||
|
}
|
||||||
|
|
||||||
|
function showLoginTip(message) {
|
||||||
|
const form = document.getElementById('loginForm');
|
||||||
|
if (!form) return;
|
||||||
|
|
||||||
|
let tip = document.getElementById('fr-login-tip');
|
||||||
|
if (!tip) {
|
||||||
|
tip = document.createElement('div');
|
||||||
|
tip.id = 'fr-login-tip';
|
||||||
|
tip.className = 'alert alert-info'; // fine even without Bootstrap
|
||||||
|
tip.style.marginTop = '8px';
|
||||||
|
form.prepend(tip);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear & rebuild so we can add the demo hint cleanly
|
||||||
|
tip.textContent = '';
|
||||||
|
tip.append(document.createTextNode(message || ''));
|
||||||
|
|
||||||
|
if (isDemoHost()) {
|
||||||
|
const line = document.createElement('div');
|
||||||
|
line.style.marginTop = '6px';
|
||||||
|
const mk = (txt) => { const k = document.createElement('code'); k.textContent = txt; return k; };
|
||||||
|
line.append(
|
||||||
|
document.createTextNode('Demo login — user: '), mk('demo'),
|
||||||
|
document.createTextNode(' · pass: '), mk('demo')
|
||||||
|
);
|
||||||
|
tip.append(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function wireModalEnterDefault() {
|
function wireModalEnterDefault() {
|
||||||
if (window.__FR_FLAGS.wired.enterDefault) return;
|
if (window.__FR_FLAGS.wired.enterDefault) return;
|
||||||
window.__FR_FLAGS.wired.enterDefault = true;
|
window.__FR_FLAGS.wired.enterDefault = true;
|
||||||
@@ -908,9 +942,7 @@ function bindDarkMode() {
|
|||||||
wireCreateDropdown();
|
wireCreateDropdown();
|
||||||
keepCreateDropdownWired();
|
keepCreateDropdownWired();
|
||||||
wireModalEnterDefault();
|
wireModalEnterDefault();
|
||||||
|
showLoginTip('Please log in to continue');
|
||||||
await ensureToastReady();
|
|
||||||
window.showToast('please_log_in_to_continue', 6000);
|
|
||||||
|
|
||||||
}, { once: true }); // <— important
|
}, { once: true }); // <— important
|
||||||
})();
|
})();
|
||||||
Reference in New Issue
Block a user