Skip to content

Commit

Permalink
Storage import fix on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
docentYT committed Dec 10, 2023
1 parent 0c3715a commit 876fcaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions extensions/combined/src/background/messageHandler.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use strict";
import storage from "./Storage";
import Storage from "./Storage";

chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.message == "saveSettings") {
storage.save(request.body);
Storage.save(request.body);
}
else if (request.message == "getSetting") {
(async () => {
sendResponse(await storage.get(request.key));
sendResponse(await Storage.get(request.key));
})();
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
import storage from "./Storage";
import Storage from "./Storage";

const filter = {
url: [
Expand All @@ -11,7 +11,7 @@ const filter = {
};

chrome.webNavigation.onCreatedNavigationTarget.addListener(async (details) => {
if (!await storage.get("nextWeekAtWeekend")) return;
if (!await Storage.get("nextWeekAtWeekend")) return;
chrome.scripting.executeScript({
target: { tabId: details.tabId },
files: ["przegladaj_plan_lekcji.inject-script.js"],
Expand Down
6 changes: 3 additions & 3 deletions extensions/combined/src/background/storage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
// https://stackoverflow.com/questions/1479319/simplest-cleanest-way-to-implement-a-singleton-in-javascript
let storage = (function () {
let Storage = (function () {
// Private methods
const corrrectSettingsObject = {
plus: 0.5,
Expand Down Expand Up @@ -51,6 +51,6 @@ let storage = (function () {
}
})

Object.freeze(storage);
Object.freeze(Storage);

module.exports = storage();
module.exports = Storage();

0 comments on commit 876fcaa

Please sign in to comment.