MessageView: Get rid of 'let' for hasSignalAccount
This commit is contained in:
parent
d0efccd121
commit
bb01218e83
1 changed files with 7 additions and 6 deletions
|
@ -457,7 +457,7 @@
|
||||||
contact.number && contact.number[0] && contact.number[0].value;
|
contact.number && contact.number[0] && contact.number[0].value;
|
||||||
const haveConversation =
|
const haveConversation =
|
||||||
number && Boolean(window.ConversationController.get(number));
|
number && Boolean(window.ConversationController.get(number));
|
||||||
let hasSignalAccount = number && haveConversation;
|
const hasLocalSignalAccount = number && haveConversation;
|
||||||
|
|
||||||
const onSendMessage = number
|
const onSendMessage = number
|
||||||
? () => {
|
? () => {
|
||||||
|
@ -468,7 +468,7 @@
|
||||||
this.model.trigger('show-contact-detail', contact);
|
this.model.trigger('show-contact-detail', contact);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getProps = () => ({
|
const getProps = ({ hasSignalAccount }) => ({
|
||||||
contact: contactSelector(contact, {
|
contact: contactSelector(contact, {
|
||||||
regionCode,
|
regionCode,
|
||||||
getAbsoluteAttachmentPath,
|
getAbsoluteAttachmentPath,
|
||||||
|
@ -486,13 +486,15 @@
|
||||||
this.contactView = new Whisper.ReactWrapperView({
|
this.contactView = new Whisper.ReactWrapperView({
|
||||||
className: 'contact-wrapper',
|
className: 'contact-wrapper',
|
||||||
Component: window.Signal.Components.EmbeddedContact,
|
Component: window.Signal.Components.EmbeddedContact,
|
||||||
props: getProps(),
|
props: getProps({
|
||||||
|
hasSignalAccount: hasLocalSignalAccount,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$('.inner-bubble').prepend(this.contactView.el);
|
this.$('.inner-bubble').prepend(this.contactView.el);
|
||||||
|
|
||||||
// If we can't verify a signal account locally, we'll go to the Signal Server.
|
// If we can't verify a signal account locally, we'll go to the Signal Server.
|
||||||
if (number && !hasSignalAccount) {
|
if (number && !hasLocalSignalAccount) {
|
||||||
// eslint-disable-next-line more/no-then
|
// eslint-disable-next-line more/no-then
|
||||||
window.textsecure.messaging
|
window.textsecure.messaging
|
||||||
.getProfile(number)
|
.getProfile(number)
|
||||||
|
@ -501,8 +503,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasSignalAccount = true;
|
this.contactView.update(getProps({ hasSignalAccount: true }));
|
||||||
this.contactView.update(getProps());
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// No account available, or network connectivity problem
|
// No account available, or network connectivity problem
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue