mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Add browser extension context
This commit is contained in:
@@ -271,13 +271,13 @@ Promise.all([
|
||||
/** @type {StickyNote[]} */
|
||||
let stickyNotes = [];
|
||||
|
||||
function load() {
|
||||
/** @type {Record<string, any>} */
|
||||
let saveData = getContext().getSaveData();
|
||||
async function load() {
|
||||
/** @type {BirbSaveData|Object} */
|
||||
let saveData = await getContext().getSaveData();
|
||||
|
||||
debug("Loaded data: " + JSON.stringify(saveData));
|
||||
|
||||
if (!saveData.settings) {
|
||||
if (!('settings' in saveData)) {
|
||||
log("No user settings found in save data, starting fresh");
|
||||
}
|
||||
|
||||
@@ -373,8 +373,10 @@ Promise.all([
|
||||
error("Failed to load font: " + e);
|
||||
}
|
||||
|
||||
load();
|
||||
load().then(onLoad);
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
styleElement.textContent = STYLESHEET;
|
||||
document.head.appendChild(styleElement);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user