summaryrefslogtreecommitdiff
path: root/frontend/src/store.tsx
diff options
context:
space:
mode:
authorAAGaming <aa@mail.catvibers.me>2023-08-05 01:11:43 -0400
committermarios8543 <marios8543@gmail.com>2023-11-14 00:04:56 +0200
commit34d1a34b10f4386865f3c241c5ae4026d2bfd8bd (patch)
treed9560bceecd2cb3d0a2b89d9f75bc29a7dfdc3dd /frontend/src/store.tsx
parentcfb6fe69e3f111de0d75a9d90e570bac392e1ee3 (diff)
downloaddecky-loader-34d1a34b10f4386865f3c241c5ae4026d2bfd8bd.tar.gz
decky-loader-34d1a34b10f4386865f3c241c5ae4026d2bfd8bd.zip
Migrate most of frontend callServerMethod usage over to websocket
Diffstat (limited to 'frontend/src/store.tsx')
-rw-r--r--frontend/src/store.tsx21
1 files changed, 6 insertions, 15 deletions
diff --git a/frontend/src/store.tsx b/frontend/src/store.tsx
index bc419430..5ae98ec4 100644
--- a/frontend/src/store.tsx
+++ b/frontend/src/store.tsx
@@ -1,4 +1,4 @@
-import { InstallType, Plugin } from './plugin';
+import { InstallType, Plugin, installPlugin, installPlugins } from './plugin';
import { getSetting, setSetting } from './utils/settings';
export enum Store {
@@ -92,33 +92,24 @@ export async function getPluginList(): Promise<StorePlugin[]> {
export async function installFromURL(url: string) {
const splitURL = url.split('/');
- await window.DeckyPluginLoader.callServerMethod('install_plugin', {
- name: splitURL[splitURL.length - 1].replace('.zip', ''),
- artifact: url,
- });
+ await installPlugin(url, splitURL[splitURL.length - 1].replace('.zip', ''));
}
export async function requestPluginInstall(plugin: string, selectedVer: StorePluginVersion, installType: InstallType) {
const artifactUrl = selectedVer.artifact ?? pluginUrl(selectedVer.hash);
- await window.DeckyPluginLoader.callServerMethod('install_plugin', {
- name: plugin,
- artifact: artifactUrl,
- version: selectedVer.name,
- hash: selectedVer.hash,
- install_type: installType,
- });
+ await installPlugin(artifactUrl, plugin, selectedVer.name, selectedVer.hash, installType);
}
export async function requestMultiplePluginInstalls(requests: PluginInstallRequest[]) {
- await window.DeckyPluginLoader.callServerMethod('install_plugins', {
- requests: requests.map(({ plugin, installType, selectedVer }) => ({
+ await installPlugins(
+ requests.map(({ plugin, installType, selectedVer }) => ({
name: plugin,
artifact: selectedVer.artifact ?? pluginUrl(selectedVer.hash),
version: selectedVer.name,
hash: selectedVer.hash,
install_type: installType,
})),
- });
+ );
}
export async function checkForUpdates(plugins: Plugin[]): Promise<PluginUpdateMapping> {