[FIX] Toggle/follow thread icon (#867)

This commit is contained in:
Diego Mello 2019-05-03 10:30:34 -03:00 committed by GitHub
parent d6ed1055ee
commit 61fcadc879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -160,6 +160,7 @@ export default {
File_description: 'File description',
File_name: 'File name',
Finish_recording: 'Finish recording',
Following_thread: 'Following thread',
For_your_security_you_must_enter_your_current_password_to_continue: 'For your security, you must enter your current password to continue',
Forgot_my_password: 'Forgot my password',
Forgot_password_If_this_email_is_registered: 'If this email is registered, we\'ll send instructions on how to reset your password. If you do not receive an email shortly, please come back and try again.',
@ -332,6 +333,7 @@ export default {
unarchive: 'unarchive',
UNARCHIVE: 'UNARCHIVE',
Unblock_user: 'Unblock user',
Unfollowed_thread: 'Unfollowed thread',
Unmute: 'Unmute',
unmuted: 'unmuted',
Unpin: 'Unpin',

View File

@ -167,6 +167,7 @@ export default {
File_description: 'Descrição do arquivo',
File_name: 'Nome do arquivo',
Finish_recording: 'Encerrar gravação',
Following_thread: 'Começou a seguir tópico',
For_your_security_you_must_enter_your_current_password_to_continue: 'Para sua segurança, você precisa digitar sua senha',
Forgot_my_password: 'Esqueci minha senha',
Forgot_password_If_this_email_is_registered: 'Se este e-mail estiver cadastrado, enviaremos instruções sobre como redefinir sua senha. Se você não receber um e-mail em breve, volte e tente novamente.',
@ -330,6 +331,7 @@ export default {
unarchive: 'desarquivar',
UNARCHIVE: 'DESARQUIVAR',
Unblock_user: 'Desbloquear usuário',
Unfollowed_thread: 'Parou de seguir tópico',
Unmute: 'Permitir que o usuário fale',
unmuted: 'permitiu que o usuário fale',
Unpin: 'Desafixar Mensagem',

View File

@ -7,6 +7,7 @@ import { CustomHeaderButtons, Item } from '../../../containers/HeaderButton';
import database, { safeAddListener } from '../../../lib/realm';
import RocketChat from '../../../lib/rocketchat';
import log from '../../../utils/log';
import { showToast } from '../../../utils/info';
const styles = StyleSheet.create({
more: {
@ -69,6 +70,7 @@ class RightButtonsContainer extends React.PureComponent {
const { tmid } = this.props;
try {
await RocketChat.toggleFollowMessage(tmid, !isFollowingThread);
showToast(isFollowingThread ? 'Unfollowed thread' : 'Following thread');
} catch (e) {
console.log('TCL: RightButtonsContainer -> toggleFollowThread -> e', e);
log('toggleFollowThread', e);
@ -86,7 +88,7 @@ class RightButtonsContainer extends React.PureComponent {
<CustomHeaderButtons>
<Item
title='bell'
iconName={isFollowingThread ? 'Bell-off' : 'bell'}
iconName={isFollowingThread ? 'bell' : 'Bell-off'}
onPress={this.toggleFollowThread}
testID={isFollowingThread ? 'room-view-header-unfollow' : 'room-view-header-follow'}
/>