cicy-desktop 2.1.38 → 2.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/main.js +20 -1
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -163,7 +163,7 @@ electronApp.on("browser-window-created", (_e, win) => {
|
|
|
163
163
|
});
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
function handleDeepLink(url) {
|
|
166
|
+
async function handleDeepLink(url) {
|
|
167
167
|
log.info(`[deeplink] handleDeepLink got: ${url}`);
|
|
168
168
|
if (!url || !url.startsWith("cicy://")) return;
|
|
169
169
|
try {
|
|
@@ -176,6 +176,25 @@ function handleDeepLink(url) {
|
|
|
176
176
|
url: u.searchParams.get("url") || "",
|
|
177
177
|
token: u.searchParams.get("token") || "",
|
|
178
178
|
};
|
|
179
|
+
// Add the team HERE in the main process — robust and independent of
|
|
180
|
+
// whether a renderer is loaded/listening. (The renderer never wired up
|
|
181
|
+
// window.cicy.deeplink.onAddTeam, so the old broadcast-only path silently
|
|
182
|
+
// dropped the team.) local-teams.addTeam upserts by base_url; the
|
|
183
|
+
// homepage polls localTeams:list every few seconds so the new team shows
|
|
184
|
+
// up on its own. We still broadcast for an instant refresh.
|
|
185
|
+
if (payload.url) {
|
|
186
|
+
try {
|
|
187
|
+
const lt = require("./backends/local-teams");
|
|
188
|
+
const r = await lt.addTeam({
|
|
189
|
+
base_url: payload.url,
|
|
190
|
+
api_token: payload.token || undefined,
|
|
191
|
+
name: payload.title || undefined,
|
|
192
|
+
});
|
|
193
|
+
log.info(`[deeplink] addTeam result: ${JSON.stringify(r)}`);
|
|
194
|
+
} catch (e) {
|
|
195
|
+
log.warn(`[deeplink] addTeam failed: ${e.message}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
179
198
|
broadcastDeepLink("deeplink:addTeam", payload);
|
|
180
199
|
// Make sure SOMETHING is on screen for the user to see the result.
|
|
181
200
|
// Safe to call before whenReady — openHomepage waits for the app
|