From 953dccd22be2975a083324804d47b4e63ff72c48 Mon Sep 17 00:00:00 2001 From: Ansh Nanda Date: Tue, 12 Dec 2023 02:01:12 +0530 Subject: [PATCH] restrict user from writing a reply when its been disabled --- src/view/screens/PostThread.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/view/screens/PostThread.tsx b/src/view/screens/PostThread.tsx index 4b1f517487..68fab31861 100644 --- a/src/view/screens/PostThread.tsx +++ b/src/view/screens/PostThread.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {StyleSheet, View} from 'react-native' +import {Alert, StyleSheet, View} from 'react-native' import Animated from 'react-native-reanimated' import {useFocusEffect} from '@react-navigation/native' import {useQueryClient} from '@tanstack/react-query' @@ -54,6 +54,12 @@ export function PostThreadScreen({route}: Props) { if (thread?.type !== 'post') { return } + if (thread.post.viewer?.replyDisabled) { + return Alert.alert( + "You can't reply to this post", + "Due to the author's settings, you can't reply to this post.", + ) + } openComposer({ replyTo: { uri: thread.post.uri,