@clagentic/console 1.0.1-beta.1 → 1.0.2
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/lib/project-sessions.js +14 -3
- package/package.json +1 -1
package/lib/project-sessions.js
CHANGED
|
@@ -503,11 +503,22 @@ function attachSessions(ctx) {
|
|
|
503
503
|
return true;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
|
-
|
|
507
|
-
|
|
506
|
+
if (msg.type === "set_update_channel") {
|
|
507
|
+
var channel = msg.channel === "beta" ? "beta" : "stable";
|
|
508
|
+
ctx.setUpdateChannel && ctx.setUpdateChannel(channel);
|
|
509
|
+
return true;
|
|
510
|
+
}
|
|
508
511
|
|
|
509
512
|
if (msg.type === "check_update") {
|
|
510
|
-
|
|
513
|
+
var updateChannel = ctx.getUpdateChannel ? ctx.getUpdateChannel() : "stable";
|
|
514
|
+
fetchVersion(updateChannel).then(function (latest) {
|
|
515
|
+
if (latest && isNewer(latest, currentVersion)) {
|
|
516
|
+
setLatestVersion(latest);
|
|
517
|
+
sendTo(ws, { type: "update_available", version: latest, current: currentVersion });
|
|
518
|
+
} else {
|
|
519
|
+
sendTo(ws, { type: "up_to_date", version: currentVersion });
|
|
520
|
+
}
|
|
521
|
+
});
|
|
511
522
|
return true;
|
|
512
523
|
}
|
|
513
524
|
|
package/package.json
CHANGED