aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-29 14:20:52 -0400
committerIvan Chen <ivan@tagg.id>2021-03-29 14:20:52 -0400
commitcfd760db7c4d6b7c3f9f9aa8fe53ed4bf2f3affc (patch)
tree8fd5949d8812df02bbe763a96fda0f0d262ec635 /src/utils
parent641a98cd5d184efb5639952812f24c56c90e7f62 (diff)
added comments
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/users.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/users.ts b/src/utils/users.ts
index 0b8a0582..f9d6d6b7 100644
--- a/src/utils/users.ts
+++ b/src/utils/users.ts
@@ -175,6 +175,15 @@ export const defaultUserProfile = () => {
return defaultImage;
};
+/**
+ * Used to determine whether the logged-in user is able to view userX's private
+ * information or not.
+ *
+ * @param state redux store's root state
+ * @param userXId target userX's id
+ * @param screenType current screen type
+ * @returns true if abel to view private info, false otherwise
+ */
export const canViewProfile = (
state: RootState,
userXId: string | undefined,