From f4012ca76a5804e0c6d812197a0c0e5aebbf1ae4 Mon Sep 17 00:00:00 2001 From: Huy <77606385+therealFoxster@users.noreply.github.com> Date: Sat, 13 Apr 2024 11:36:32 -0700 Subject: [PATCH] Store URLs in uYouPlusSettings.h (#1409) --- Sources/uYouPlusSettings.h | 3 +++ Sources/uYouPlusSettings.xm | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/uYouPlusSettings.h b/Sources/uYouPlusSettings.h index bba5547..557cfa8 100644 --- a/Sources/uYouPlusSettings.h +++ b/Sources/uYouPlusSettings.h @@ -6,6 +6,9 @@ #import #import "uYouPlus.h" +NSString *UYOUPLUS_RELEASES_URL = @"https://github.com/qnblackcat/uYouPlus/releases"; +NSString *UYOUPLUS_NEW_ISSUE_URL = @"https://github.com/qnblackcat/uYouPlus/issues/new?assignees=&labels=bug&projects=&template=bug.yaml&title=[v%@] %@"; + // For displaying snackbars @interface YTHUDMessage : NSObject + (id)messageWithText:(id)text; diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index fb4236d..4dd2284 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -54,7 +54,7 @@ extern NSBundle *uYouPlusBundle(); return VERSION_STRING; } selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { - return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/qnblackcat/uYouPlus/releases"]]; + return [%c(YTUIUtils) openURL:[NSURL URLWithString:UYOUPLUS_RELEASES_URL]]; } ]; [sectionItems addObject:version]; @@ -65,7 +65,7 @@ extern NSBundle *uYouPlusBundle(); accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { - NSString *url = [NSString stringWithFormat:@"https://github.com/qnblackcat/uYouPlus/issues/new?assignees=&labels=bug&projects=&template=bug.yaml&title=[v%@] %@", VERSION_STRING, LOC(@"ADD_TITLE")]; + NSString *url = [NSString stringWithFormat:UYOUPLUS_NEW_ISSUE_URL, VERSION_STRING, LOC(@"ADD_TITLE")]; return [%c(YTUIUtils) openURL:[NSURL URLWithString:[url stringByReplacingOccurrencesOfString:@" " withString:@"%20"]]]; }