Removed unused state.

pull/50/head
Mikunj 6 years ago
parent 50e8f65a7e
commit 4fd709be35

@ -80,7 +80,6 @@
verified: textsecure.storage.protocol.VerifiedStatus.DEFAULT,
isFriend: false,
keyExchangeCompleted: false,
blockInput: false,
unlockTimestamp: null, // Timestamp used for expiring friend requests.
};
},
@ -1094,31 +1093,21 @@
return true;
});
},
async updateBlockInput(blockInput) {
if (this.get('blockInput') === blockInput) return;
this.set({ blockInput });
await window.Signal.Data.updateConversation(this.id, this.attributes, {
Conversation: Whisper.Conversation,
});
},
async updateTextInputState() {
// Check if we need to disable the text field
if (!this.isFriend()) {
// Disable the input if we're waiting for friend request approval
const waiting = await this.waitingForFriendRequestApproval();
if (waiting) {
await this.updateBlockInput(true);
this.trigger('disable:input', true);
this.trigger('change:placeholder', 'disabled');
return;
}
// Tell the user to introduce themselves
await this.updateBlockInput(false);
this.trigger('disable:input', false);
this.trigger('change:placeholder', 'friend-request');
return;
}
await this.updateBlockInput(false);
this.trigger('disable:input', false);
this.trigger('change:placeholder', 'chat');
},

@ -69,16 +69,9 @@
},
template: $('#conversation').html(),
render_attributes() {
let sendMessagePlaceholder = 'sendMessageFriendRequest';
const sendDisabled = this.model.get('blockInput');
if (sendDisabled) {
sendMessagePlaceholder = 'sendMessageDisabled';
} else if (this.model.isFriend()) {
sendMessagePlaceholder = 'sendMessage';
}
return {
'disable-inputs': sendDisabled,
'send-message': i18n(sendMessagePlaceholder),
'disable-inputs': false,
'send-message': i18n('sendMessage'),
'android-length-warning': i18n('androidMessageLengthWarning'),
};
},

Loading…
Cancel
Save