Skip to content

Commit

Permalink
[FIX] Toggle/follow thread icon (#867)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello committed May 3, 2019
1 parent d6ed105 commit 61fcadc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down Expand Up @@ -332,6 +333,7 @@ export default {
unarchive: 'unarchive',
UNARCHIVE: 'UNARCHIVE',
Unblock_user: 'Unblock user',
Unfollowed_thread: 'Unfollowed thread',
Unmute: 'Unmute',
unmuted: 'unmuted',
Unpin: 'Unpin',
Expand Down
2 changes: 2 additions & 0 deletions app/i18n/locales/pt-BR.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down Expand Up @@ -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',
Expand Down
4 changes: 3 additions & 1 deletion app/views/RoomView/Header/RightButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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);
Expand All @@ -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'}
/>
Expand Down

0 comments on commit 61fcadc

Please sign in to comment.