diff --git a/Mini vMac/AppDelegate.m b/Mini vMac/AppDelegate.m index 34a9000..3e63dc0 100644 --- a/Mini vMac/AppDelegate.m +++ b/Mini vMac/AppDelegate.m @@ -189,7 +189,7 @@ NSString *DocumentsChangedNotification = @"documentsChanged"; - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler { BOOL success = NO; - if ([shortcutItem.type isEqualToString:@"disk"] && sharedEmulator.isRunning) { + if ([shortcutItem.type isEqualToString:@"disk"]) { NSString *fileName = (NSString*)shortcutItem.userInfo[@"disk"]; NSString *filePath = [self.documentsPath stringByAppendingPathComponent:fileName]; if ([[NSFileManager defaultManager] fileExistsAtPath:filePath] && ![sharedEmulator isDiskInserted:filePath]) { diff --git a/Mini vMac/DefaultSceneDelegate.swift b/Mini vMac/DefaultSceneDelegate.swift index 83d54a7..d556abe 100644 --- a/Mini vMac/DefaultSceneDelegate.swift +++ b/Mini vMac/DefaultSceneDelegate.swift @@ -42,4 +42,8 @@ class DefaultSceneDelegate: UIResponder, UIWindowSceneDelegate { func sceneDidBecomeActive(_ scene: UIScene) { AppDelegate.emulator.isRunning = true } + + func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) { + AppDelegate.shared.application(UIApplication.shared, performActionFor: shortcutItem, completionHandler: completionHandler) + } }