diff options
| author | marios <marios8543@gmail.com> | 2022-05-26 04:00:18 +0300 |
|---|---|---|
| committer | marios <marios8543@gmail.com> | 2022-05-26 04:00:18 +0300 |
| commit | 4b923c1dc70eaa4a3ca58d9e9f3218785b2fe919 (patch) | |
| tree | 3394a7e752b61bdfa16b1a7f50842c4e1dbc0972 /frontend/src/index.tsx | |
| parent | 74438a31458af8bddd08d90eacc6d63677bab844 (diff) | |
| download | decky-loader-4b923c1dc70eaa4a3ca58d9e9f3218785b2fe919.tar.gz decky-loader-4b923c1dc70eaa4a3ca58d9e9f3218785b2fe919.zip | |
display overhaul, compatibility with legacy plugins, fixes
Diffstat (limited to 'frontend/src/index.tsx')
| -rw-r--r-- | frontend/src/index.tsx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx new file mode 100644 index 00000000..13118ca3 --- /dev/null +++ b/frontend/src/index.tsx @@ -0,0 +1,21 @@ +import PluginLoader from "./plugin-loader" + +declare global { + interface Window { + DeckyPluginLoader: PluginLoader; + importDeckyPlugin: Function; + syncDeckyPlugins: Function; + } +} +window.DeckyPluginLoader = new PluginLoader(); +window.importDeckyPlugin = function(name: string) { + window.DeckyPluginLoader?.importPlugin(name); +} +window.syncDeckyPlugins = async function() { + const plugins = await (await fetch("http://127.0.0.1:1337/plugins")).json(); + for (const plugin of plugins) { + window.DeckyPluginLoader?.importPlugin(plugin); + } +} + +setTimeout(() => window.syncDeckyPlugins(), 5000);
\ No newline at end of file |
