Skip to content

Commit

Permalink
Make all sent messages appear read (#1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf authored Dec 28, 2024
1 parent e50d2cf commit 2b7f4bd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Mlem.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3035,7 +3035,7 @@
repositoryURL = "https://github.com/mlemgroup/MlemMiddleware";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.57.0;
minimumVersion = 0.58.0;
};
};
CD64A9182CA37D63007CA7E6 /* XCRemoteSwiftPackageReference "Gifu" */ = {
Expand Down
4 changes: 2 additions & 2 deletions Mlem/App/Models/Session/GuestSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class GuestSession: Session {
self.account = account

Task {
try await self.api.fetchSiteVersion(task: Task {
try await self.api.contextDataManager.getValue(task: Task {
let (_, instance, _) = try await self.api.getMyPerson()
self.instance = instance
Task { @MainActor in
self.account.update(instance: instance)
}
return instance.version
return .init(instance: instance, person: nil)
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions Mlem/App/Models/Session/UserSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class UserSession: Session {

Task { @MainActor in
do {
try await self.api.fetchSiteVersion(task: Task {
try await self.api.contextDataManager.getValue(task: Task {
let (person, instance, blocks) = try await self.api.getMyPerson()
if let person {
self.account.update(person: person, instance: instance)
self.person = person
}
self.blocks = blocks
self.instance = instance
return instance.version
return .init(instance: instance, person: person)
})

try await self.api.getSubscriptionList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import MlemMiddleware

extension Message1Providing {
var self2: (any Message2Providing)? { self as? any Message2Providing }

var isOwnMessage: Bool { creatorId == api.myPerson?.id }


func swipeActions(behavior: SwipeBehavior) -> SwipeConfiguration {
.init(
behavior: behavior,
Expand Down
2 changes: 1 addition & 1 deletion Mlem/App/Views/Pages/DeleteAccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct DeleteAccountView: View {
content
.task {
do {
try await account.api.fetchSiteVersion()
try await account.api.ensureContextPresence()
} catch {
handleError(error)
}
Expand Down

0 comments on commit 2b7f4bd

Please sign in to comment.