From b5042cc764feb052ccf0d33b27cdfce06276d176 Mon Sep 17 00:00:00 2001 From: vinkwok Date: Thu, 11 May 2023 00:40:31 +0800 Subject: [PATCH] patch(discordKit): update usages with small API changes pin DiscordKit dep to latest commit --- Swiftcord.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- Swiftcord/Utils/Keychain.swift | 6 +++--- Swiftcord/Views/ContentView.swift | 5 ++++- Swiftcord/Views/Message/StickerView.swift | 2 +- Swiftcord/Views/OnboardingView.swift | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Swiftcord.xcodeproj/project.pbxproj b/Swiftcord.xcodeproj/project.pbxproj index 881c3a08..9b7ee8a6 100644 --- a/Swiftcord.xcodeproj/project.pbxproj +++ b/Swiftcord.xcodeproj/project.pbxproj @@ -1800,8 +1800,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SwiftcordApp/DiscordKit"; requirement = { - branch = devel; - kind = branch; + kind = revision; + revision = c2f7e6a48611fac03456f725f6e4f5d3609d297b; }; }; DA8AEA6629029747007BAAEA /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */ = { diff --git a/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index fc867c2e..48f3f458 100644 --- a/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/SwiftcordApp/DiscordKit", "state" : { - "branch" : "devel", - "revision" : "bd8a0fb1e812d72374a90ef863395c6d71a11b0f" + "branch" : "main", + "revision" : "c2f7e6a48611fac03456f725f6e4f5d3609d297b" } }, { diff --git a/Swiftcord/Utils/Keychain.swift b/Swiftcord/Utils/Keychain.swift index a0aa5b02..2511c7de 100644 --- a/Swiftcord/Utils/Keychain.swift +++ b/Swiftcord/Utils/Keychain.swift @@ -19,7 +19,7 @@ public class Keychain { kSecAttrAccount: "\(Bundle.main.bundleIdentifier!).\(key)", kSecAttrApplicationTag: tag, kSecValueData: data - ] as CFDictionary + ] as [CFString: Any] as CFDictionary SecItemDelete(query) @@ -33,7 +33,7 @@ public class Keychain { kSecAttrAccount: "\(Bundle.main.bundleIdentifier!).\(key)", kSecAttrApplicationTag: tag, kSecMatchLimit: kSecMatchLimitOne - ] as CFDictionary + ] as [CFString: Any] as CFDictionary return SecItemDelete(query) } @@ -50,7 +50,7 @@ public class Keychain { kSecReturnData: true, kSecAttrApplicationTag: tag, kSecMatchLimit: kSecMatchLimitOne - ] as CFDictionary + ] as [CFString: Any] as CFDictionary var dataTypeRef: AnyObject? diff --git a/Swiftcord/Views/ContentView.swift b/Swiftcord/Views/ContentView.swift index c462f3ad..6fd71470 100644 --- a/Swiftcord/Views/ContentView.swift +++ b/Swiftcord/Views/ContentView.swift @@ -172,6 +172,7 @@ struct ContentView: View { if state == .gatewayConn { loadLastSelectedGuild() } if state == .messageLoad, !seenOnboarding || prevBuild != Bundle.main.infoDictionary?["CFBundleVersion"] as? String { // swiftlint:disable:this indentation_width + // If the user hasn't seen the onboarding (first page), present onboarding immediately if !seenOnboarding { presentingOnboarding = true } Task { do { @@ -180,7 +181,9 @@ struct ContentView: View { .body } catch { skipWhatsNew = true + return } + // If the user has already seen the onboarding, present the onboarding sheet only after loading the changelog presentingOnboarding = true } } @@ -213,7 +216,7 @@ struct ContentView: View { } content: { OnboardingView( skipOnboarding: seenOnboarding, - skipWhatsNew: skipWhatsNew, + skipWhatsNew: $skipWhatsNew, newMarkdown: $whatsNewMarkdown, presenting: $presentingOnboarding ) diff --git a/Swiftcord/Views/Message/StickerView.swift b/Swiftcord/Views/Message/StickerView.swift index 136a4a95..57a950df 100644 --- a/Swiftcord/Views/Message/StickerView.swift +++ b/Swiftcord/Views/Message/StickerView.swift @@ -159,7 +159,7 @@ struct StickerView: View { .onHover { hovered = $0 } .onTapGesture { if fullSticker == nil { Task { - fullSticker = try? await restAPI.getSticker(id: sticker.id) + fullSticker = try? await restAPI.getSticker(sticker.id) openPopoverEvt() }} else { openPopoverEvt() diff --git a/Swiftcord/Views/OnboardingView.swift b/Swiftcord/Views/OnboardingView.swift index 1663ceb7..88488c9c 100644 --- a/Swiftcord/Views/OnboardingView.swift +++ b/Swiftcord/Views/OnboardingView.swift @@ -90,7 +90,7 @@ struct OnboardingWelcomeView: View { struct OnboardingView: View { let skipOnboarding: Bool - let skipWhatsNew: Bool + @Binding var skipWhatsNew: Bool @Binding var newMarkdown: String? @State private var showingNew = false