MCPcopy Create free account
hub / github.com/garrytan/gstack / setDisconnected

Function setDisconnected

extension/background.js:101–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101function setDisconnected() {
102 const wasConnected = isConnected;
103 isConnected = false;
104 // Keep authToken — it persists across reconnections
105 chrome.action.setBadgeText({ text: '' });
106
107 chrome.runtime.sendMessage({ type: 'health', data: null }).catch((err) => {
108 console.debug('[gstack bg] No listener for disconnect broadcast:', err.message);
109 });
110
111 // Notify content scripts on disconnection
112 if (wasConnected) {
113 notifyContentScripts('disconnected');
114 }
115}
116
117async function notifyContentScripts(type) {
118 try {

Callers 1

checkHealthFunction · 0.85

Calls 1

notifyContentScriptsFunction · 0.85

Tested by

no test coverage detected