From 5452ce4933980d024f700844e7e051502b0ff3dd Mon Sep 17 00:00:00 2001 From: Sjmarf <78750526+Sjmarf@users.noreply.github.com> Date: Fri, 8 Dec 2023 23:12:20 +0000 Subject: [PATCH] Update --- Mlem/Logic/Abbreviate Numbers.swift | 5 ++++- Mlem/Models/Content/Inbox/MentionModel.swift | 6 +++--- Mlem/Models/Content/Inbox/ReplyModel.swift | 6 +++--- Mlem/Views/Shared/Posts/ExpandedPostLogic.swift | 4 ++-- Mlem/Views/Shared/Posts/Feed Post.swift | 6 +++--- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Mlem/Logic/Abbreviate Numbers.swift b/Mlem/Logic/Abbreviate Numbers.swift index d26a5cec4..50e4385ae 100644 --- a/Mlem/Logic/Abbreviate Numbers.swift +++ b/Mlem/Logic/Abbreviate Numbers.swift @@ -8,8 +8,11 @@ import Foundation func abbreviateNumber(_ number: Int) -> String { + if number >= 10_000_000 { + return "\(Int(round(Double(number) / 1_000_000)))M" + } if number >= 1_000_000 { - return "\(Double(round(Double(number) / 100) / 10))M" + return "\(Double(round(Double(number) / 100_000) / 10))M" } if number >= 10_000 { return "\(Int(round(Double(number) / 1000)))K" diff --git a/Mlem/Models/Content/Inbox/MentionModel.swift b/Mlem/Models/Content/Inbox/MentionModel.swift index 16cf8b314..2db1d65f8 100644 --- a/Mlem/Models/Content/Inbox/MentionModel.swift +++ b/Mlem/Models/Content/Inbox/MentionModel.swift @@ -210,7 +210,7 @@ extension MentionModel { // upvote ret.append(MenuFunction.standardMenuFunction( - text: votes.myVote == .upvote ? "Undo upvote" : "Upvote", + text: votes.myVote == .upvote ? "Undo Upvote" : "Upvote", imageName: votes.myVote == .upvote ? Icons.upvoteSquareFill : Icons.upvoteSquare, destructiveActionPrompt: nil, enabled: true @@ -222,7 +222,7 @@ extension MentionModel { // downvote ret.append(MenuFunction.standardMenuFunction( - text: votes.myVote == .downvote ? "Undo downvote" : "Downvote", + text: votes.myVote == .downvote ? "Undo Downvote" : "Downvote", imageName: votes.myVote == .downvote ? Icons.downvoteSquareFill : Icons.downvoteSquare, destructiveActionPrompt: nil, enabled: true @@ -234,7 +234,7 @@ extension MentionModel { // toggle read ret.append(MenuFunction.standardMenuFunction( - text: personMention.read ? "Mark unread" : "Mark read", + text: personMention.read ? "Mark Unread" : "Mark Read", imageName: personMention.read ? Icons.markUnread : Icons.markRead, destructiveActionPrompt: nil, enabled: true diff --git a/Mlem/Models/Content/Inbox/ReplyModel.swift b/Mlem/Models/Content/Inbox/ReplyModel.swift index 27712ffb7..00eff5bcf 100644 --- a/Mlem/Models/Content/Inbox/ReplyModel.swift +++ b/Mlem/Models/Content/Inbox/ReplyModel.swift @@ -205,7 +205,7 @@ extension ReplyModel { // upvote ret.append(MenuFunction.standardMenuFunction( - text: votes.myVote == .upvote ? "Undo upvote" : "Upvote", + text: votes.myVote == .upvote ? "Undo Upvote" : "Upvote", imageName: votes.myVote == .upvote ? Icons.upvoteSquareFill : Icons.upvoteSquare, destructiveActionPrompt: nil, enabled: true @@ -217,7 +217,7 @@ extension ReplyModel { // downvote ret.append(MenuFunction.standardMenuFunction( - text: votes.myVote == .downvote ? "Undo downvote" : "Downvote", + text: votes.myVote == .downvote ? "Undo Downvote" : "Downvote", imageName: votes.myVote == .downvote ? Icons.downvoteSquareFill : Icons.downvoteSquare, destructiveActionPrompt: nil, enabled: true @@ -229,7 +229,7 @@ extension ReplyModel { // toggle read ret.append(MenuFunction.standardMenuFunction( - text: commentReply.read ? "Mark unread" : "Mark read", + text: commentReply.read ? "Mark Unread" : "Mark Read", imageName: commentReply.read ? Icons.markUnread : Icons.markRead, destructiveActionPrompt: nil, enabled: true diff --git a/Mlem/Views/Shared/Posts/ExpandedPostLogic.swift b/Mlem/Views/Shared/Posts/ExpandedPostLogic.swift index 693681693..32e5b59f3 100644 --- a/Mlem/Views/Shared/Posts/ExpandedPostLogic.swift +++ b/Mlem/Views/Shared/Posts/ExpandedPostLogic.swift @@ -96,7 +96,7 @@ extension ExpandedPost { // upvote let (upvoteText, upvoteImg) = post.votes.myVote == .upvote ? - ("Undo upvote", Icons.upvoteSquareFill) : + ("Undo Upvote", Icons.upvoteSquareFill) : ("Upvote", Icons.upvoteSquare) ret.append(MenuFunction.standardMenuFunction( text: upvoteText, @@ -111,7 +111,7 @@ extension ExpandedPost { // downvote let (downvoteText, downvoteImg) = post.votes.myVote == .downvote ? - ("Undo downvote", Icons.downvoteSquareFill) : + ("Undo Downvote", Icons.downvoteSquareFill) : ("Downvote", Icons.downvoteSquare) ret.append(MenuFunction.standardMenuFunction( text: downvoteText, diff --git a/Mlem/Views/Shared/Posts/Feed Post.swift b/Mlem/Views/Shared/Posts/Feed Post.swift index 9b54c0073..3ed8b4862 100644 --- a/Mlem/Views/Shared/Posts/Feed Post.swift +++ b/Mlem/Views/Shared/Posts/Feed Post.swift @@ -298,7 +298,7 @@ struct FeedPost: View { // upvote let (upvoteText, upvoteImg) = post.votes.myVote == .upvote ? - ("Undo upvote", Icons.upvoteSquareFill) : + ("Undo Upvote", Icons.upvoteSquareFill) : ("Upvote", Icons.upvoteSquare) ret.append(MenuFunction.standardMenuFunction( text: upvoteText, @@ -313,7 +313,7 @@ struct FeedPost: View { // downvote let (downvoteText, downvoteImg) = post.votes.myVote == .downvote ? - ("Undo downvote", Icons.downvoteSquareFill) : + ("Undo Downvote", Icons.downvoteSquareFill) : ("Downvote", Icons.downvoteSquare) ret.append(MenuFunction.standardMenuFunction( text: downvoteText, @@ -404,7 +404,7 @@ struct FeedPost: View { ret.append(MenuFunction.standardMenuFunction( text: "Block Community", imageName: Icons.hide, - destructiveActionPrompt: nil, + destructiveActionPrompt: AppConstants.blockCommunityPrompt, enabled: true ) { Task(priority: .userInitiated) {