From ec86fb77b03bb47e3f8a72a8a68d3be70deb6299 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 2 Mar 2022 15:58:01 -0800 Subject: [PATCH] [AltServer] Fixes prematurely fetching installed apps --- AltServer/AppDelegate.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AltServer/AppDelegate.swift b/AltServer/AppDelegate.swift index 58943f99..524c5d66 100644 --- a/AltServer/AppDelegate.swift +++ b/AltServer/AppDelegate.swift @@ -534,8 +534,14 @@ extension AppDelegate: NSMenuDelegate func menuDidClose(_ menu: NSMenu) { + guard menu == self.appMenu else { return } + // Clearing _jitAppListMenuControllers now prevents action handler from being called. // self._jitAppListMenuControllers = [] + + // Set `submenuHandler` to nil to prevent prematurely fetching installed apps in menuWillOpen(_:) + // when assigning self.connectedDevices to `items` (which implicitly calls `submenuHandler`) + self.enableJITMenuController.submenuHandler = nil } func menu(_ menu: NSMenu, willHighlight item: NSMenuItem?)