demon.require -> demon.summon

hehe funny demon reference
pull/1/head
Drake 2 years ago
parent 25a1873bdb
commit cb9513745e

2
dist/build.js vendored

File diff suppressed because one or more lines are too long

@ -3,7 +3,7 @@ import { idb, nests } from "./common"
const nest = nests.make()
async function init() {
const extNest = demon.require("internal/nest")
const extNest = demon.summon("internal/nest")
if (!window.__demon) { // this *shouldn't* be required but if we magically run into a race condition it's better to be safe
window.__demon = {}
}
@ -34,7 +34,7 @@ async function init() {
}
async function add(iife, meta) {
const extNest = demon.require("internal/nest")
const extNest = demon.summon("internal/nest")
const currdemon = await idb.get("demon")
currdemon.plugins[meta.name] = {
initialize: iife,
@ -46,7 +46,7 @@ async function add(iife, meta) {
}
async function del(name) {
const extNest = demon.require("internal/nest")
const extNest = demon.summon("internal/nest")
const currdemon = await idb.get("demon")
if (!!currdemon.plugins[name])
if (currdemon.status[name].running) {
@ -61,7 +61,7 @@ async function del(name) {
}
async function toggle(name) {
const extNest = demon.require("internal/nest")
const extNest = demon.summon("internal/nest")
const currdemon = await idb.get("demon")
if (!!currdemon.plugins[name]) {
if (currdemon.status[name]?.running) {

@ -8,7 +8,7 @@ const FormSection = webpack.findByDisplayName("FormSection");
const FormDivider = webpack.findByDisplayName("FormDivider");
export default () => {
const extNest = demon.require("internal/nest")
const extNest = demon.summon("internal/nest")
nestsReact.useNest(extNest)
return (<>
<Header size="demon-settings-header-size30">Plugins</Header>

@ -27,7 +27,7 @@ function isAllowed(mod) {
return true
}
function require(mod) {
function summon(mod) {
if (!isAllowed(mod)) {
throw new Error("Not allowed!"); //TODO: make this not irrepairably error out
}
@ -44,7 +44,7 @@ function require(mod) {
}
window.demon = {
require
summon
}
plugins.init()

Loading…
Cancel
Save