aboutsummaryrefslogtreecommitdiff
path: root/src/components/messages/ChannelPreview.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/messages/ChannelPreview.tsx')
-rw-r--r--src/components/messages/ChannelPreview.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/messages/ChannelPreview.tsx b/src/components/messages/ChannelPreview.tsx
index 4a0cee0b..87b94179 100644
--- a/src/components/messages/ChannelPreview.tsx
+++ b/src/components/messages/ChannelPreview.tsx
@@ -1,5 +1,5 @@
import {useNavigation} from '@react-navigation/core';
-import React, {useContext} from 'react';
+import React, {useContext, useState} from 'react';
import {Image, StyleSheet, Text, View} from 'react-native';
import {
RectButton,
@@ -41,7 +41,7 @@ const ChannelPreview: React.FC<
const member = getMember(channel, state);
const online = isOnline(member?.user?.last_active);
const unread = channel.state.unreadCount > 0;
- const isMuted = channel.muteStatus().muted;
+ const [isMuted, setIsMuted] = useState(channel.muteStatus().muted);
const mutedImage = isMuted
? require('../../assets/images/unmute.png')
: require('../../assets/images/mute.png');
@@ -60,6 +60,7 @@ const ChannelPreview: React.FC<
} else {
channel.mute();
}
+ setIsMuted(!isMuted);
}}>
<Image source={mutedImage} style={styles.icon} />
<Text style={styles.actionText}>{isMuted ? 'Unmute' : 'Mute'}</Text>