Skip to content

Commit

Permalink
Show warning when installing legacy plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Jul 17, 2022
1 parent f015e00 commit 6e88c7c
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions frontend/src/components/store/Store.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SteamSpinner } from 'decky-frontend-lib';
import { ModalRoot, SteamSpinner, showModal, staticClasses } from 'decky-frontend-lib';
import { FC, useEffect, useState } from 'react';

import PluginCard from './PluginCard';
Expand Down Expand Up @@ -38,16 +38,32 @@ export async function installFromURL(url: string) {
});
}

export async function requestLegacyPluginInstall(plugin: LegacyStorePlugin, selectedVer: string) {
const formData = new FormData();
formData.append('name', plugin.artifact);
formData.append('artifact', `https://github.com/${plugin.artifact}/archive/refs/tags/${selectedVer}.zip`);
formData.append('version', selectedVer);
formData.append('hash', plugin.versions[selectedVer]);
await fetch('http://localhost:1337/browser/install_plugin', {
method: 'POST',
body: formData,
});
export function requestLegacyPluginInstall(plugin: LegacyStorePlugin, selectedVer: string) {
showModal(
<ModalRoot
onOK={() => {
const formData = new FormData();
formData.append('name', plugin.artifact);
formData.append('artifact', `https://github.com/${plugin.artifact}/archive/refs/tags/${selectedVer}.zip`);
formData.append('version', selectedVer);
formData.append('hash', plugin.versions[selectedVer]);
fetch('http://localhost:1337/browser/install_plugin', {
method: 'POST',
body: formData,
});
}}
onCancel={() => {
// do nothing
}}
>
<div className={staticClasses.Title} style={{ flexDirection: 'column' }}>
Using legacy plugins
</div>
You are currently installing a <b>legacy</b> plugin. Legacy plugins are no longer supported and may have issues.
Legacy plugins do not support gamepad input. To interact with a legacy plugin, you will need to use the
touchscreen.
</ModalRoot>,
);
}

export async function requestPluginInstall(plugin: StorePlugin, selectedVer: StorePluginVersion) {
Expand Down

0 comments on commit 6e88c7c

Please sign in to comment.