Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch #344

Merged
merged 9 commits into from
Dec 1, 2024
Merged

Watch #344

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 44 additions & 28 deletions DanXi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
273B11E72BD3B37A001F7757 /* SettingsNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273B11E62BD3B37A001F7757 /* SettingsNavigation.swift */; };
273D53332BD94AC200801B77 /* DanXiKit in Frameworks */ = {isa = PBXBuildFile; productRef = 273D53322BD94AC200801B77 /* DanXiKit */; };
273D53352BD94AC200801B77 /* DanXiUI in Frameworks */ = {isa = PBXBuildFile; productRef = 273D53342BD94AC200801B77 /* DanXiUI */; };
273EA8862CF77FEE00FC4DEB /* Utils in Frameworks */ = {isa = PBXBuildFile; productRef = 273EA8852CF77FEE00FC4DEB /* Utils */; };
274C197329D1BF9B000DE221 /* WatchApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274C197229D1BF9B000DE221 /* WatchApp.swift */; };
274C197529D1BF9B000DE221 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274C197429D1BF9B000DE221 /* ContentView.swift */; };
274C197729D1BF9C000DE221 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 274C197629D1BF9C000DE221 /* Assets.xcassets */; };
Expand All @@ -32,6 +33,9 @@
27C6B4782C2B3895006841C7 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 27C6B4772C2B3895006841C7 /* Localizable.xcstrings */; };
27C6B4792C2B3895006841C7 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 27C6B4772C2B3895006841C7 /* Localizable.xcstrings */; };
27C6B47A2C2B3895006841C7 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 27C6B4772C2B3895006841C7 /* Localizable.xcstrings */; };
27D226152CF7826400AF63B4 /* ViewUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 27D226142CF7826400AF63B4 /* ViewUtils */; };
27D226172CF782E900AF63B4 /* FudanUI in Frameworks */ = {isa = PBXBuildFile; productRef = 27D226162CF782E900AF63B4 /* FudanUI */; };
27D226192CF78FE700AF63B4 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 27D226182CF78FE700AF63B4 /* InfoPlist.xcstrings */; };
27D3A49F2BBC9F0800350D21 /* DanXi Widget.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 27536EBD29DC9A8100894A98 /* DanXi Widget.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
27D3A4A82BBCFA3D00350D21 /* FudanKit in Frameworks */ = {isa = PBXBuildFile; productRef = 27D3A4A72BBCFA3D00350D21 /* FudanKit */; };
27D6F4542892C5D70059228F /* BundleResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27D6F4532892C5D70059228F /* BundleResource.swift */; };
Expand All @@ -46,7 +50,6 @@
E5A316A62BE4C9CB00BCC41A /* BusWidgetIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A316A52BE4C9CB00BCC41A /* BusWidgetIntent.swift */; };
E5A316A72BE4C9CB00BCC41A /* BusWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A316A42BE4C9CB00BCC41A /* BusWidget.swift */; };
F13306D82BA5766C005361D2 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = F13306D72BA5766C005361D2 /* InfoPlist.xcstrings */; };
F13306D92BA5766C005361D2 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = F13306D72BA5766C005361D2 /* InfoPlist.xcstrings */; };
F15059FD2BBD60F200EA62E3 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F15059FC2BBD60F200EA62E3 /* PrivacyInfo.xcprivacy */; };
F1A762D62BAFD1B7001E5D08 /* IntroSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A762D52BAFD1B7001E5D08 /* IntroSheet.swift */; };
/* End PBXBuildFile section */
Expand All @@ -59,13 +62,6 @@
remoteGlobalIDString = 27536EBC29DC9A8100894A98;
remoteInfo = "DanXi Wigdet";
};
27D3A4A02BBC9F0800350D21 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8AC7A5C526872C3E00C9CD98 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 27536EBC29DC9A8100894A98;
remoteInfo = "DanXi Wigdet";
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -108,6 +104,7 @@
27066031292F56AF00F4C321 /* license.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = license.json; sourceTree = "<group>"; };
27066037292FA34200F4C321 /* contributor.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = contributor.json; sourceTree = "<group>"; };
270CD1902BAD68C900881ABA /* View Utils */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = "View Utils"; sourceTree = "<group>"; };
271298362CF79D4D002D1481 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2737C7E62BCFF4F0001945C1 /* DanXi Kit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = "DanXi Kit"; sourceTree = "<group>"; };
2737C7E72BCFF56C001945C1 /* DanXiUI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = DanXiUI; sourceTree = "<group>"; };
273B11E62BD3B37A001F7757 /* SettingsNavigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsNavigation.swift; sourceTree = "<group>"; };
Expand All @@ -127,6 +124,7 @@
27AF614C2BCD61DE00754718 /* TabNavigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabNavigation.swift; sourceTree = "<group>"; };
27C68CB12BB563A100037D52 /* Utils */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Utils; sourceTree = "<group>"; };
27C6B4772C2B3895006841C7 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
27D226182CF78FE700AF63B4 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
27D6F4532892C5D70059228F /* BundleResource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleResource.swift; sourceTree = "<group>"; };
27DD19B22BA5C16900B75643 /* Fudan Kit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = "Fudan Kit"; sourceTree = "<group>"; };
27E1C52C29D09CF700B333BA /* AppModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppModel.swift; sourceTree = "<group>"; };
Expand All @@ -152,7 +150,10 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
273EA8862CF77FEE00FC4DEB /* Utils in Frameworks */,
27D3A4A82BBCFA3D00350D21 /* FudanKit in Frameworks */,
27D226152CF7826400AF63B4 /* ViewUtils in Frameworks */,
27D226172CF782E900AF63B4 /* FudanUI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -185,9 +186,11 @@
274C197129D1BF9B000DE221 /* watchOS */ = {
isa = PBXGroup;
children = (
271298362CF79D4D002D1481 /* Info.plist */,
274C197229D1BF9B000DE221 /* WatchApp.swift */,
274C197429D1BF9B000DE221 /* ContentView.swift */,
274C197629D1BF9C000DE221 /* Assets.xcassets */,
27D226182CF78FE700AF63B4 /* InfoPlist.xcstrings */,
);
path = watchOS;
sourceTree = "<group>";
Expand All @@ -212,7 +215,6 @@
2778D5F52891C664009F4DB1 /* Assets.xcassets */,
27066037292FA34200F4C321 /* contributor.json */,
27066031292F56AF00F4C321 /* license.json */,
F13306D72BA5766C005361D2 /* InfoPlist.xcstrings */,
F15059FC2BBD60F200EA62E3 /* PrivacyInfo.xcprivacy */,
27C6B4772C2B3895006841C7 /* Localizable.xcstrings */,
);
Expand Down Expand Up @@ -295,6 +297,7 @@
8AC7A5CF26872C3E00C9CD98 /* iOS */ = {
isa = PBXGroup;
children = (
F13306D72BA5766C005361D2 /* InfoPlist.xcstrings */,
27E1C52E29D0AD6F00B333BA /* AppDelegate.swift */,
8AAABD4326881E0500486D37 /* DanXi.entitlements */,
8AC7A5D926872C3F00C9CD98 /* Info.plist */,
Expand All @@ -320,6 +323,9 @@
name = "DanXi Watch";
packageProductDependencies = (
27D3A4A72BBCFA3D00350D21 /* FudanKit */,
273EA8852CF77FEE00FC4DEB /* Utils */,
27D226142CF7826400AF63B4 /* ViewUtils */,
27D226162CF782E900AF63B4 /* FudanUI */,
);
productName = "DanXi-watch Watch App";
productReference = 274C197029D1BF9B000DE221 /* DanXi Watch.app */;
Expand Down Expand Up @@ -360,7 +366,6 @@
);
dependencies = (
27D3A49A2BBC9D5300350D21 /* PBXTargetDependency */,
27D3A4A12BBC9F0800350D21 /* PBXTargetDependency */,
);
name = DanXi;
packageProductDependencies = (
Expand Down Expand Up @@ -424,9 +429,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F13306D92BA5766C005361D2 /* InfoPlist.xcstrings in Resources */,
274C197729D1BF9C000DE221 /* Assets.xcassets in Resources */,
27C6B4792C2B3895006841C7 /* Localizable.xcstrings in Resources */,
27D226192CF78FE700AF63B4 /* InfoPlist.xcstrings in Resources */,
27E1178C2A782BC90006EE20 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -504,11 +509,6 @@
target = 27536EBC29DC9A8100894A98 /* DanXi Widget */;
targetProxy = 27D3A4992BBC9D5300350D21 /* PBXContainerItemProxy */;
};
27D3A4A12BBC9F0800350D21 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 27536EBC29DC9A8100894A98 /* DanXi Widget */;
targetProxy = 27D3A4A02BBC9F0800350D21 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
Expand All @@ -519,26 +519,27 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 463;
CURRENT_PROJECT_VERSION = 500;
DEVELOPMENT_TEAM = KF7M99CN68;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = watchOS/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "DanXi-watch";
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "";
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "io.github.danxi-dev.dan-xi";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.1.1;
PRODUCT_BUNDLE_IDENTIFIER = .watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 10.0;
WATCHOS_DEPLOYMENT_TARGET = 11.0;
};
name = Debug;
};
Expand All @@ -549,18 +550,19 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 463;
CURRENT_PROJECT_VERSION = 500;
DEVELOPMENT_TEAM = KF7M99CN68;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = watchOS/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "DanXi-watch";
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "";
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "io.github.danxi-dev.dan-xi";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.1.1;
PRODUCT_BUNDLE_IDENTIFIER = .watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -569,7 +571,7 @@
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
VALIDATE_PRODUCT = YES;
WATCHOS_DEPLOYMENT_TARGET = 10.0;
WATCHOS_DEPLOYMENT_TARGET = 11.0;
};
name = Release;
};
Expand All @@ -595,7 +597,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.1.1;
PRODUCT_BUNDLE_IDENTIFIER = "io.github.danxi-dev.dan-xi.widget";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -629,7 +631,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.1.1;
PRODUCT_BUNDLE_IDENTIFIER = "io.github.danxi-dev.dan-xi.widget";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -704,6 +706,7 @@
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
Expand Down Expand Up @@ -763,6 +766,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O";
};
name = Release;
Expand All @@ -789,7 +793,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.1.1;
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "io.github.danxi-dev.dan-xi";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -828,7 +832,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.1.1;
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "io.github.danxi-dev.dan-xi";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -900,6 +904,10 @@
isa = XCSwiftPackageProductDependency;
productName = DanXiUI;
};
273EA8852CF77FEE00FC4DEB /* Utils */ = {
isa = XCSwiftPackageProductDependency;
productName = Utils;
};
2785E2A72BC8645100D50D31 /* FudanUI */ = {
isa = XCSwiftPackageProductDependency;
productName = FudanUI;
Expand All @@ -912,6 +920,14 @@
isa = XCSwiftPackageProductDependency;
productName = Utils;
};
27D226142CF7826400AF63B4 /* ViewUtils */ = {
isa = XCSwiftPackageProductDependency;
productName = ViewUtils;
};
27D226162CF782E900AF63B4 /* FudanUI */ = {
isa = XCSwiftPackageProductDependency;
productName = FudanUI;
};
27D3A4A72BBCFA3D00350D21 /* FudanKit */ = {
isa = XCSwiftPackageProductDependency;
productName = FudanKit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "7e02cc504e721b34c51348fcdae7d65a3f6f0e7f3ae3ed52e13f9c90198fdf93",
"originHash" : "ba090f79995e048a92a142ac48dea65dd392f7d92b5407b2c5220f8ae5b417ec",
"pins" : [
{
"identity" : "bettersafariview",
Expand All @@ -19,6 +19,15 @@
"version" : "0.6.4"
}
},
{
"identity" : "efqrcode",
"kind" : "remoteSourceControl",
"location" : "https://github.com/EFPrefix/EFQRCode.git",
"state" : {
"revision" : "3a6c5012f1a0df404a92e55bb01b4b685ff5a2d1",
"version" : "6.2.2"
}
},
{
"identity" : "keychainaccess",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -91,6 +100,15 @@
"version" : "2.3.1"
}
},
{
"identity" : "swift_qrcodejs",
"kind" : "remoteSourceControl",
"location" : "https://github.com/EFPrefix/swift_qrcodejs.git",
"state" : {
"revision" : "817ba220a2eba840bae888e7eeb11207bec05f8c",
"version" : "2.3.0"
}
},
{
"identity" : "swiftsoup",
"kind" : "remoteSourceControl",
Expand Down
2 changes: 2 additions & 0 deletions DanXiUI/Forum/Model/ForumSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class ForumSettings: ObservableObject {
@AppStorage("sensitive-content") public var foldedContent = SensitiveContentSetting.fold
@AppStorage("blocked-tags") public var blockedTags: [String] = []
@AppStorage("blocked-holes") public var blockedHoles: [Int] = []
@AppStorage("hidden-my-holes") public var hiddenMyHoles: [Int] = []
@AppStorage("hidden-my-replies") public var hiddenMyReplies: [Int] = []
@AppStorage("screenshot-alert") public var screenshotAlert = true
@AppStorage("show-activity") public var showBanners = true
@AppStorage("in-app-browser") var inAppBrowser = true
Expand Down
23 changes: 20 additions & 3 deletions DanXiUI/Forum/Pages/MyPostPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,32 @@ import ViewUtils
import DanXiKit

struct MyPostPage: View {
@ObservedObject private var settings = ForumSettings.shared

var body: some View {
ForumList {
AsyncCollection { (presentations: [HolePresentation]) in
let holes = try await ForumAPI.listMyHoles(startTime: presentations.last?.hole.timeUpdated)
return holes.map { HolePresentation(hole: $0) }
} content: { presentation in
Section {
HoleView(presentation: presentation)
.listRowInsets(EdgeInsets(top: 8, leading: 12, bottom: 8, trailing: 12))
if !settings.hiddenMyHoles.contains(presentation.hole.id) {
Section {
HoleView(presentation: presentation)
.listRowInsets(EdgeInsets(top: 8, leading: 12, bottom: 8, trailing: 12))
}
.swipeActions {
Button(role: .destructive) {
withAnimation {
settings.hiddenMyHoles.append(presentation.hole.id)
}
} label: {
Label {
Text("Hide", bundle: .module)
} icon: {
Image(systemName: "eye.slash")
}
}
}
}
}
}
Expand Down
Loading