Skip to content

Commit

Permalink
Update uYouPlusSettings.xm
Browse files Browse the repository at this point in the history
  • Loading branch information
arichornlover authored Dec 18, 2024
1 parent 7e79ac2 commit bf48c76
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Sources/uYouPlusSettings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ extern NSBundle *uYouPlusBundle();
// Import Settings functionality
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.text"] inMode:UIDocumentPickerModeImport];
documentPicker.allowsMultipleSelection = NO;
documentPicker.delegate = self;
[settingsViewController presentViewController:documentPicker animated:YES completion:nil];
return YES;
} else {
Expand Down Expand Up @@ -1625,7 +1626,6 @@ NSString *cacheDescription = [NSString stringWithFormat:@"%@", GetCacheSize()];
NSLog(@"Error reading file: %@", error.localizedDescription);
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:@"Error" message:@"Failed to read the settings file." preferredStyle:UIAlertControllerStyleAlert];
[errorAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
[settingsViewController presentViewController:errorAlert animated:YES completion:nil];
return;
}
NSArray *lines = [settingsString componentsSeparatedByString:@"\n"];
Expand All @@ -1637,9 +1637,7 @@ NSString *cacheDescription = [NSString stringWithFormat:@"%@", GetCacheSize()];
[[NSUserDefaults standardUserDefaults] setObject:value forKey:key];
}
}
[settingsViewController reloadData];
[[%c(GOOHUDManagerInternal) sharedInstance] showMessageMainThread:[%c(YTHUDMessage) messageWithText:@"Settings imported"]];
SHOW_RELAUNCH_YT_SNACKBAR;
}
}

Expand Down

1 comment on commit bf48c76

@arichornlover
Copy link
Owner Author

@arichornlover arichornlover commented on bf48c76 Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a few months, I’ve finally resolved the issue of documentPicker.delegate = self; not being declared. It was surprisingly simple; updating just one file in YouTubeHeader fixed the problem. Well now hopefully the Importing Settings function as intended.

Please sign in to comment.