Skip to content

Commit

Permalink
patch(discordKit): update usages with small API changes
Browse files Browse the repository at this point in the history
pin DiscordKit dep to latest commit
  • Loading branch information
cryptoAlgorithm committed May 10, 2023
1 parent 87afcdd commit b5042cc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Swiftcord.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftcordApp/DiscordKit",
"state" : {
"branch" : "devel",
"revision" : "bd8a0fb1e812d72374a90ef863395c6d71a11b0f"
"branch" : "main",
"revision" : "c2f7e6a48611fac03456f725f6e4f5d3609d297b"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions Swiftcord/Utils/Keychain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}
Expand All @@ -50,7 +50,7 @@ public class Keychain {
kSecReturnData: true,
kSecAttrApplicationTag: tag,
kSecMatchLimit: kSecMatchLimitOne
] as CFDictionary
] as [CFString: Any] as CFDictionary

var dataTypeRef: AnyObject?

Expand Down
5 changes: 4 additions & 1 deletion Swiftcord/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
}
Expand Down Expand Up @@ -213,7 +216,7 @@ struct ContentView: View {
} content: {
OnboardingView(
skipOnboarding: seenOnboarding,
skipWhatsNew: skipWhatsNew,
skipWhatsNew: $skipWhatsNew,
newMarkdown: $whatsNewMarkdown,
presenting: $presentingOnboarding
)
Expand Down
2 changes: 1 addition & 1 deletion Swiftcord/Views/Message/StickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Swiftcord/Views/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b5042cc

Please sign in to comment.