diff options
| author | marios8543 <marios8543@gmail.com> | 2023-10-17 16:07:43 +0300 |
|---|---|---|
| committer | marios8543 <marios8543@gmail.com> | 2023-10-31 23:17:49 +0200 |
| commit | 39f64ca6667a0e8703a7a52d6e2bf0da57ee2cb6 (patch) | |
| tree | c66694a983f4869cecb728c44928e01a1da97b07 /frontend | |
| parent | 2391af09eb8d97e485804d8f5c8798a0f1f776a8 (diff) | |
| download | decky-loader-39f64ca6667a0e8703a7a52d6e2bf0da57ee2cb6.tar.gz decky-loader-39f64ca6667a0e8703a7a52d6e2bf0da57ee2cb6.zip | |
Drop support for legacy plugins
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/components/LegacyPlugin.tsx | 11 | ||||
| -rw-r--r-- | frontend/src/plugin-loader.tsx | 19 |
2 files changed, 2 insertions, 28 deletions
diff --git a/frontend/src/components/LegacyPlugin.tsx b/frontend/src/components/LegacyPlugin.tsx deleted file mode 100644 index f0dd2521..00000000 --- a/frontend/src/components/LegacyPlugin.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { VFC } from 'react'; - -interface Props { - url: string; -} - -const LegacyPlugin: VFC<Props> = ({ url }) => { - return <iframe style={{ border: 'none', width: '100%', height: '100%' }} src={url}></iframe>; -}; - -export default LegacyPlugin; diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index b27a19bb..e5f69f1f 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -13,7 +13,6 @@ import { FC, lazy } from 'react'; import { FaExclamationCircle, FaPlug } from 'react-icons/fa'; import { DeckyState, DeckyStateContextProvider, UserInfo, useDeckyState } from './components/DeckyState'; -import LegacyPlugin from './components/LegacyPlugin'; import { File, FileSelectionType } from './components/modals/filepicker'; import { deinitFilepickerPatches, initFilepickerPatches } from './components/modals/filepicker/patches'; import MultiplePluginsInstallModal from './components/modals/MultiplePluginsInstallModal'; @@ -238,7 +237,7 @@ class PluginLoader extends Logger { public unloadPlugin(name: string) { console.log('Plugin List: ', this.plugins); - const plugin = this.plugins.find((plugin) => plugin.name === name || plugin.name === name.replace('$LEGACY_', '')); + const plugin = this.plugins.find((plugin) => plugin.name === name); plugin?.onDismount?.(); this.plugins = this.plugins.filter((p) => p !== plugin); this.deckyState.setPlugins(this.plugins); @@ -256,12 +255,7 @@ class PluginLoader extends Logger { this.log(`Trying to load ${name}`); this.unloadPlugin(name); - - if (name.startsWith('$LEGACY_')) { - await this.importLegacyPlugin(name.replace('$LEGACY_', '')); - } else { - await this.importReactPlugin(name, version); - } + await this.importReactPlugin(name, version); this.deckyState.setPlugins(this.plugins); this.log(`Loaded ${name}`); @@ -342,15 +336,6 @@ class PluginLoader extends Logger { } else throw new Error(`${name} frontend_bundle not OK`); } - private async importLegacyPlugin(name: string) { - const url = `http://127.0.0.1:1337/plugins/load_main/${name}`; - this.plugins.push({ - name: name, - icon: <FaPlug />, - content: <LegacyPlugin url={url} />, - }); - } - async callServerMethod(methodName: string, args = {}) { const response = await fetch(`http://127.0.0.1:1337/methods/${methodName}`, { method: 'POST', |
