Skip to content

Commit

Permalink
- Updated icon for collapse comment settings
Browse files Browse the repository at this point in the history
- Updated collapseComment flag name to be more consistent
  • Loading branch information
schmeat committed Jan 3, 2024
1 parent 5c36133 commit 25a70ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Mlem/API/Internal/HierarchicalComment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ extension [APICommentView] {

/// Recursively populates child comments by looking up IDs from `childrenById`
func populateChildren(_ comment: APICommentView) -> HierarchicalComment {
let collapseChildCommentsFlag = UserDefaults.standard.bool(forKey: "collapseCommentReplies")
let collapseChildCommentsFlag = UserDefaults.standard.bool(forKey: "collapseChildComments")
// Collapse all child comments and excluse parents comments
let isCollapsed = collapseChildCommentsFlag && !(comment.comment.parentId == nil)

Expand Down
3 changes: 2 additions & 1 deletion Mlem/Icons.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation
import SwiftUI

/// SFSymbol names for icons
struct Icons {
enum Icons {
// votes
static let votes: String = "arrow.up.arrow.down.square"
static let upvote: String = "arrow.up"
Expand Down Expand Up @@ -183,6 +183,7 @@ struct Icons {
static let developerMode: String = "wrench.adjustable.fill"
static let limitImageHeightSetting: String = "rectangle.compress.vertical"
static let swipeUpGestureSetting: String = "arrow.up.to.line.alt"
static let collapseComments: String = "arrow.down.and.line.horizontal.and.arrow.up"

// misc
static let switchUser: String = "person.crop.circle.badge.plus"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct CommentSettingsView: View {
@AppStorage("shouldShowUserServerInComment") var shouldShowUserServerInComment: Bool = false

@AppStorage("showCommentJumpButton") var showCommentJumpButton: Bool = true
@AppStorage("collapseCommentReplies") var collapseChildComments: Bool = false
@AppStorage("collapseChildComments") var collapseChildComments: Bool = false
@AppStorage("commentJumpButtonSide") var commentJumpButtonSide: JumpButtonLocation = .bottomTrailing

var body: some View {
Expand Down Expand Up @@ -117,7 +117,7 @@ struct CommentSettingsView: View {
isTicked: $showCommentJumpButton
)
SwitchableSettingsItem(
settingPictureSystemName: Icons.absent,
settingPictureSystemName: Icons.collapseComments,
settingName: "Automatically Collapse Replies",
isTicked: $collapseChildComments
)
Expand Down

0 comments on commit 25a70ba

Please sign in to comment.