Skip to content

Commit

Permalink
fix: init on reload when removed last active package only
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreDemailly committed Dec 7, 2024
1 parent 518a986 commit ff973a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ document.addEventListener("DOMContentLoaded", async() => {
}
});
searchview.reset();
await init();
const nsnActivePackage = secureDataSet.linker.get(0);
const nsnRootPackage = `${nsnActivePackage.name}@${nsnActivePackage.version}`;
if (data.status === "RELOAD" && nsnRootPackage !== window.activePackage) {
// it means we removed the previous active package, which is still active in network, so we need to re-init
await init();
}
}
else if (data.status === "SCAN") {
searchview.onScan(data.pkg);
Expand Down

0 comments on commit ff973a7

Please sign in to comment.