Skip to content

Commit

Permalink
re-added comment haptics
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBAndrews committed Nov 12, 2023
1 parent adf639e commit f90bdbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Mlem/Views/Shared/Comments/Comment Item Logic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SwiftUI

extension CommentItem {
func voteOnComment(inputOp: ScoringOperation) async {
hapticManager.play(haptic: .lightSuccess, priority: .low)
let operation = hierarchicalComment.commentView.myVote == inputOp ? ScoringOperation.resetVote : inputOp
do {
let updatedComment = try await commentRepository.voteOnComment(
Expand All @@ -22,6 +23,7 @@ extension CommentItem {
}

func deleteComment() async {
hapticManager.play(haptic: .success, priority: .low)
let comment = hierarchicalComment.commentView.comment
do {
let updatedComment = try await commentRepository.deleteComment(
Expand Down Expand Up @@ -118,6 +120,8 @@ extension CommentItem {
dirty = true
dirtySaved.toggle()

hapticManager.play(haptic: .success, priority: .low)

do {
let response = try await commentRepository.saveComment(
id: hierarchicalComment.id,
Expand Down
1 change: 1 addition & 0 deletions Mlem/Views/Shared/Comments/Comment Item.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct CommentItem: View {
@Dependency(\.errorHandler) var errorHandler
@Dependency(\.notifier) var notifier
@Dependency(\.siteInformation) var siteInformation
@Dependency(\.hapticManager) var hapticManager

// appstorage
@AppStorage("shouldShowScoreInCommentBar") var shouldShowScoreInCommentBar: Bool = true
Expand Down

0 comments on commit f90bdbd

Please sign in to comment.