remove checkForSignalAccount()

pull/1183/head
Audric Ackermann 5 years ago
parent 6a13839d9d
commit b9c1bd7089
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -37,37 +37,10 @@
window.doesAcountCheckJobExist = number =>
Boolean(window.AccountJobs[number]);
window.checkForSignalAccount = number => {
if (window.AccountJobs[number]) {
return window.AccountJobs[number];
}
let job;
if (textsecure.messaging) {
// eslint-disable-next-line more/no-then
job = textsecure.messaging
.getProfile(number)
.then(() => {
window.AccountCache[number] = true;
})
.catch(() => {
window.AccountCache[number] = false;
});
} else {
// We're offline!
job = Promise.resolve().then(() => {
window.AccountCache[number] = false;
});
}
window.AccountJobs[number] = job;
return job;
};
window.isSignalAccountCheckComplete = number =>
window.AccountCache[number] !== undefined;
window.hasSignalAccount = number => window.AccountCache[number];
window.hasSignalAccount = () => true;
window.Whisper.Message = Backbone.Model.extend({
initialize(attributes) {
@ -706,7 +679,6 @@
: null;
const onClick = async () => {
// First let's be sure that the signal account check is complete.
await window.checkForSignalAccount(firstNumber);
this.trigger('show-contact-detail', {
contact,
@ -714,13 +686,6 @@
});
};
// Would be nice to do this before render, on initial load of message
if (!window.isSignalAccountCheckComplete(firstNumber)) {
window.checkForSignalAccount(firstNumber).then(() => {
this.trigger('change', this);
});
}
return contactSelector(contact, {
regionCode,
getAbsoluteAttachmentPath,

Loading…
Cancel
Save