17 lines
534 B
JavaScript
17 lines
534 B
JavaScript
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";
|
|
}
|
|
});
|