@bobfrankston/rmfmail 1.2.10 → 1.2.11
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/bin/mailx.js +44 -1
- package/bin/mailx.js.map +1 -1
- package/bin/mailx.ts +41 -1
- package/client/app.bundle.js +11 -3
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +19 -5
- package/client/app.js.map +1 -1
- package/client/app.ts +17 -4
- package/package.json +1 -1
package/client/app.ts
CHANGED
|
@@ -2941,14 +2941,27 @@ onWsEvent((event) => {
|
|
|
2941
2941
|
banner.style.background = "oklch(0.52 0.14 150)";
|
|
2942
2942
|
// Stash the update banner contents so updateFailed can restore
|
|
2943
2943
|
// it (offering a retry) instead of leaving "Updating..." pinned.
|
|
2944
|
-
|
|
2944
|
+
// `local:true` means a newer build is ALREADY installed on disk
|
|
2945
|
+
// (npmglobalize finished) — we just need to restart onto it, no
|
|
2946
|
+
// npm install. That path is network-free and does a clean
|
|
2947
|
+
// daemon handoff (the fresh daemon kills this one). The remote
|
|
2948
|
+
// path (a published version not yet installed) still runs
|
|
2949
|
+
// performUpdate (npm install + restart).
|
|
2950
|
+
const isLocal = !!(event as any).local;
|
|
2951
|
+
const verb = isLocal ? "installed" : "available";
|
|
2952
|
+
const label = isLocal ? "Restart to apply" : "Update now";
|
|
2953
|
+
const restoreHtml = `${APP_NAME} ${event.latest} ${verb} (you have ${event.current}) — <button id="btn-do-update" style="background:none;border:1px solid #fff;color:#fff;padding:0.15em 0.5em;border-radius:3px;cursor:pointer;margin-left:0.5em">${label}</button>`;
|
|
2945
2954
|
(window as any).__mailxUpdateBannerHtml = restoreHtml;
|
|
2946
2955
|
text.innerHTML = restoreHtml;
|
|
2947
2956
|
document.getElementById("btn-do-update")?.addEventListener("click", () => {
|
|
2948
|
-
text.textContent = "Updating... mailx will restart when done";
|
|
2949
|
-
// performUpdate runs npm install then restarts the service
|
|
2950
2957
|
const ipc = (window as any).mailxapi || (window as any).opener?.mailxapi;
|
|
2951
|
-
if (ipc?.
|
|
2958
|
+
if (isLocal && ipc?.restartDaemon) {
|
|
2959
|
+
text.textContent = "Restarting onto the new version...";
|
|
2960
|
+
ipc.restartDaemon();
|
|
2961
|
+
} else {
|
|
2962
|
+
text.textContent = "Updating... mailx will restart when done";
|
|
2963
|
+
if (ipc?.performUpdate) ipc.performUpdate();
|
|
2964
|
+
}
|
|
2952
2965
|
});
|
|
2953
2966
|
}
|
|
2954
2967
|
break;
|