Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf committed Jan 18, 2024
1 parent 3ca243f commit 6993c0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Mlem/Models/Trackers/SiteInformationTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SiteInformationTracker: ObservableObject {
@Published var version: SiteVersion?
@Published private(set) var allLanguages: [APILanguage] = .init()
@Published var myUserInfo: APIMyUserInfo?
@Published var slurFilterRegex: Regex<Void>?

func load(account: SavedAccount) {
version = account.siteVersion
Expand All @@ -35,6 +36,11 @@ class SiteInformationTracker: ObservableObject {
}
myUserInfo = response.myUser
allLanguages = response.allLanguages

print("REGEX", response.siteView.localSite.slurFilterRegex)
if let regex = response.siteView.localSite.slurFilterRegex {
slurFilterRegex = try .init(regex)
}
} catch {
errorHandler.handle(error)
}
Expand Down
2 changes: 2 additions & 0 deletions Mlem/Views/Shared/Composer/PostComposerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ struct PostComposerView: View {
self._postBody = State(initialValue: editModel.editPost?.post.body ?? "")
self._isNSFW = State(initialValue: editModel.editPost?.post.nsfw ?? false)
self._attachmentModel = StateObject(wrappedValue: .init(url: editModel.editPost?.post.linkUrl?.description ?? ""))

print(siteInformation.slurFilterRegex)
}

var body: some View {
Expand Down

0 comments on commit 6993c0e

Please sign in to comment.