fix: await initApp() + fulltextSearch for reliable restore
This commit is contained in:
@@ -261,7 +261,7 @@ window.doLogin = async function() {
|
|||||||
var p = document.getElementById('login-pass').value;
|
var p = document.getElementById('login-pass').value;
|
||||||
if (await loginUser(u, p)) {
|
if (await loginUser(u, p)) {
|
||||||
document.getElementById('sidebar').style.display = 'flex';
|
document.getElementById('sidebar').style.display = 'flex';
|
||||||
initApp();
|
await initApp();
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('login-err').style.display = 'block';
|
document.getElementById('login-err').style.display = 'block';
|
||||||
}
|
}
|
||||||
@@ -347,7 +347,7 @@ async function initApp() {
|
|||||||
moduleListEl.style.display = 'none';
|
moduleListEl.style.display = 'none';
|
||||||
searchResultsEl.style.display = 'block';
|
searchResultsEl.style.display = 'block';
|
||||||
searchResultsEl.innerHTML = '<p style="font-size:13px;color:#888">Restoring search...</p>';
|
searchResultsEl.innerHTML = '<p style="font-size:13px;color:#888">Restoring search...</p>';
|
||||||
fulltextSearch(savedQ);
|
await fulltextSearch(savedQ);
|
||||||
} else {
|
} else {
|
||||||
// Load initial module from hash or default
|
// Load initial module from hash or default
|
||||||
var hash = location.hash.slice(1);
|
var hash = location.hash.slice(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user