Indicate in the desktop if the user gets rate limited for indexing

This commit is contained in:
sabaimran
2023-11-25 22:31:23 -08:00
parent 73e38fccf3
commit 52b88de7f4
4 changed files with 27 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
const setFolderButton = document.getElementById('update-folder');
const setFileButton = document.getElementById('update-file');
const showKey = document.getElementById('show-key');
const loadingBar = document.getElementById('loading-bar');
const needsSubscriptionElement = document.getElementById('needs-subscription');
async function removeFile(filePath) {
const updatedFiles = await window.removeFileAPI.removeFile(filePath);
@@ -165,6 +165,15 @@ window.updateStateAPI.onUpdateState((event, state) => {
syncStatusElement.innerHTML = `⏱️ Synced at ${currentTime.toLocaleTimeString(undefined, options)}. Next sync at ${nextSyncTime.toLocaleTimeString(undefined, options)}.`;
});
window.needsSubscriptionAPI.onNeedsSubscription((event, needsSubscription) => {
console.log("needs subscription", needsSubscription);
if (needsSubscription) {
needsSubscriptionElement.style.display = 'block';
} else {
needsSubscriptionElement.style.display = 'none';
}
});
const urlInput = document.getElementById('khoj-host-url');
(async function() {
const url = await window.hostURLAPI.getURL();