Skip to content

Commit

Permalink
Fix: launcher not proceeding after fully downloaded
Browse files Browse the repository at this point in the history
Turns out 2 last commits were pointless and didn't fix the root issue at all
  • Loading branch information
khanhduytran0 committed Aug 3, 2024
1 parent e021b7d commit 6935671
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Natives/LauncherNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
self.progressViewMain.observedProgress = nil;
if (self.task.metadata) {
[self invokeAfterJITEnabled:^{
UIKit_launchMinecraftSurfaceVC(self.task.metadata);
UIKit_launchMinecraftSurfaceVC(self.view.window, self.task.metadata);
}];
} else {
self.task = nil;
Expand Down
2 changes: 1 addition & 1 deletion Natives/ios_uikit_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ UIViewController* tmpRootVC;

void showDialog(NSString* title, NSString* message);
jstring UIKit_accessClipboard(JNIEnv* env, jint action, jstring copySrc);
void UIKit_launchMinecraftSurfaceVC(NSDictionary *metadata);
void UIKit_launchMinecraftSurfaceVC(UIWindow *window, NSDictionary *metadata);
void UIKit_returnToSplitView();
void launchInitialViewController(UIWindow *window);

Expand Down
3 changes: 1 addition & 2 deletions Natives/ios_uikit_bridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ jstring UIKit_accessClipboard(JNIEnv* env, jint action, jbyteArray copySrc) {
}
}

void UIKit_launchMinecraftSurfaceVC(NSDictionary* metadata) {
void UIKit_launchMinecraftSurfaceVC(UIWindow* window, NSDictionary* metadata) {
// Leave this pref, might be useful later for launching with Quick Actions/Shortcuts/URL Scheme
//setPreference(@"internal_launch_on_boot", getPreference(@"restart_before_launch"));
setPrefObject(@"internal.selected_account", BaseAuthenticator.current.authData[@"username"]);
dispatch_async(dispatch_get_main_queue(), ^{
UIWindow *window = currentWindow();
tmpRootVC = window.rootViewController;
[UIView animateWithDuration:0.2 animations:^{
window.alpha = 0;
Expand Down

0 comments on commit 6935671

Please sign in to comment.