some lib fixes

This commit is contained in:
2026-03-22 04:37:35 +02:00
parent 422dca818e
commit 76ed05aed6
4 changed files with 89 additions and 3 deletions

View File

@@ -9,6 +9,26 @@ const LEGACY_GATING_KEY = "cmajghqmadhnadjcjhamajdhda";
const bundled = require("./jibo-sdk");
function registerPulsarUriOpeners() {
try {
if (typeof atom === "undefined" || !atom.workspace || typeof atom.workspace.addOpener !== "function") return;
atom.workspace.addOpener((uri) => {
if (uri === "atom://jibo-cheat-sheet") {
const CheatSheetTab = require("./cheat-sheet/cheat-sheat-tab");
return new CheatSheetTab();
}
if (uri === "atom://atom-react-styleguide") {
const StyleguideEditor = require("./atom-react/styleguide/styleguide-editor");
return new StyleguideEditor();
}
return undefined;
});
} catch (_) {
// Best-effort only.
}
}
function forceLegacyLoginFlag() {
try {
if (typeof globalThis !== "undefined" && globalThis.localStorage) {
@@ -23,7 +43,9 @@ if (bundled && typeof bundled.activate === "function") {
const originalActivate = bundled.activate.bind(bundled);
bundled.activate = function activate(state) {
forceLegacyLoginFlag();
return originalActivate(state);
const result = originalActivate(state);
registerPulsarUriOpeners();
return result;
};
}