mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
refactor headless sync
This commit is contained in:
@@ -62,6 +62,8 @@ function initSyncStatusBar(plugin, wsListener) {
|
||||
|
||||
popoverOpen = true;
|
||||
|
||||
wsListener.subscribeLogs(vaultId);
|
||||
|
||||
outsideClickHandler = (e) => {
|
||||
if (!item.contains(e.target)) {
|
||||
hidePopover();
|
||||
@@ -84,6 +86,7 @@ function initSyncStatusBar(plugin, wsListener) {
|
||||
outsideClickHandler = null;
|
||||
}
|
||||
|
||||
wsListener.unsubscribeLogs();
|
||||
popoverOpen = false;
|
||||
}
|
||||
|
||||
@@ -119,6 +122,13 @@ function initSyncStatusBar(plugin, wsListener) {
|
||||
return { prefix: "Syncing", path: match[1].trim() };
|
||||
}
|
||||
|
||||
// Uploading file / Upload complete path
|
||||
match = line.match(/^(?:Uploading file|Upload complete|New file)\s+(.+)$/);
|
||||
|
||||
if (match) {
|
||||
return { prefix: "Syncing", path: match[1].trim() };
|
||||
}
|
||||
|
||||
// Deleting path
|
||||
match = line.match(/^Deleting\s+(.+)$/);
|
||||
|
||||
@@ -238,8 +248,7 @@ function initSyncStatusBar(plugin, wsListener) {
|
||||
let wasDisconnected = false;
|
||||
|
||||
const wsCheckInterval = setInterval(() => {
|
||||
const ws = window.__ignisWs;
|
||||
const disconnected = !ws || ws.readyState !== WebSocket.OPEN;
|
||||
const disconnected = !wsListener.isConnected();
|
||||
|
||||
if (disconnected && currentStatus === "running") {
|
||||
updateState("error", "Server connection lost");
|
||||
|
||||
Reference in New Issue
Block a user