From 2b3c219e382a889ef299b8cb49abfbbd15ec1686 Mon Sep 17 00:00:00 2001
From: TrainDoctor <traindoctor@protonmail.com>
Date: Sun, 3 Jul 2022 14:11:04 -0700
Subject: * Async onOK

* await confirm_plugin_install

* wait until we've exited store to re-open QAM
---
 frontend/src/plugin-loader.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'frontend/src/plugin-loader.tsx')

diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx
index 61e7ac42..20b93cca 100644
--- a/frontend/src/plugin-loader.tsx
+++ b/frontend/src/plugin-loader.tsx
@@ -1,4 +1,4 @@
-import { ModalRoot, QuickAccessTab, Router, showModal, staticClasses } from 'decky-frontend-lib';
+import { ModalRoot, QuickAccessTab, Router, showModal, sleep, staticClasses } from 'decky-frontend-lib';
 import { FaPlug } from 'react-icons/fa';
 
 import { DeckyState, DeckyStateContextProvider } from './components/DeckyState';
@@ -56,8 +56,10 @@ class PluginLoader extends Logger {
   public addPluginInstallPrompt(artifact: string, version: string, request_id: string, hash: string) {
     showModal(
       <ModalRoot
-        onOK={() => {
-          this.callServerMethod('confirm_plugin_install', { request_id });
+        onOK={async () => {
+          await this.callServerMethod('confirm_plugin_install', { request_id });
+          Router.NavigateBackOrOpenMenu();
+          await sleep(250);
           setTimeout(() => Router.OpenQuickAccessMenu(QuickAccessTab.Decky), 1000);
         }}
         onCancel={() => {
@@ -89,7 +91,7 @@ class PluginLoader extends Logger {
         }}
       >
         <div className={staticClasses.Title} style={{ flexDirection: 'column' }}>
-          Uninstall {name}?
+          Uninstall {name}?b
         </div>
       </ModalRoot>,
     );
-- 
cgit v1.2.3

