703a0cd630
don't need this layer of indirection
19 lines
585 B
JavaScript
19 lines
585 B
JavaScript
const browser = require("webextension-polyfill");
|
|
|
|
console.log("popup.js running");
|
|
|
|
const getLocalStorage = browser.storage.sync.get();
|
|
|
|
document.querySelector("#options").addEventListener("click", () => {
|
|
browser.runtime.openOptionsPage();
|
|
});
|
|
|
|
getLocalStorage.then((result) => {
|
|
const loggedInSelector = document.querySelector("#loggedInMsg");
|
|
if (result.credentials && result.credentials.urbitId && result.credentials.urbitCode) {
|
|
loggedInSelector.textContent = `Hi, ~${result.credentials.urbitId}`;
|
|
} else {
|
|
loggedInSelector.textContent = "Not logged in";
|
|
}
|
|
});
|