diff --git a/js/background.js b/js/background.js index ca167d886..e9f43c901 100644 --- a/js/background.js +++ b/js/background.js @@ -1364,7 +1364,7 @@ ); }); - Whisper.events.on('deviceUnpairingRequested', async pubKey => { + Whisper.events.on('deviceUnpairingRequested', async (pubKey, callback) => { await libloki.storage.removePairingAuthorisationForSecondaryPubKey( pubKey ); @@ -1374,6 +1374,7 @@ // Remove all traces of the device ConversationController.deleteContact(pubKey); Whisper.events.trigger('refreshLinkedDeviceList'); + callback(); }); } diff --git a/ts/components/DevicePairingDialog.tsx b/ts/components/DevicePairingDialog.tsx index b87d43b6e..05407f441 100644 --- a/ts/components/DevicePairingDialog.tsx +++ b/ts/components/DevicePairingDialog.tsx @@ -211,6 +211,7 @@ export class DevicePairingDialog extends React.Component { buttonColor={SessionButtonColor.Danger} /> + ); @@ -370,13 +371,19 @@ export class DevicePairingDialog extends React.Component { } private triggerUnpairDevice() { + const deviceUnpaired = () => { + window.pushToast({ + title: window.i18n('deviceUnpaired'), + }); + this.closeDialog(); + this.setState({ loading: false }); + }; + this.setState({ loading: true }); + window.Whisper.events.trigger( 'deviceUnpairingRequested', - this.props.pubKeyToUnpair + this.props.pubKeyToUnpair, + deviceUnpaired ); - window.pushToast({ - title: window.i18n('deviceUnpaired'), - }); - this.closeDialog(); } } diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index 0e5d7fd21..98b43c557 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -1066,6 +1066,8 @@ export class Message extends React.PureComponent { selected, multiSelectMode, conversationType, + isPublic, + text, } = this.props; const { expired, expiring } = this.state; @@ -1088,15 +1090,13 @@ export class Message extends React.PureComponent { // We parse the message later, but we still need to do an early check // to see if the message mentions us, so we can display the entire // message differently - const mentions = this.props.text - ? this.props.text.match(window.pubkeyPattern) - : []; + const mentions = text ? text.match(window.pubkeyPattern) : []; const mentionMe = mentions && mentions.some(m => m.slice(1) === window.lokiPublicChatAPI.ourKey); const isIncoming = direction === 'incoming'; - const shouldHightlight = mentionMe && isIncoming && this.props.isPublic; + const shouldHightlight = mentionMe && isIncoming && isPublic; const divClasses = ['loki-message-wrapper']; if (shouldHightlight) { diff --git a/ts/components/session/RegistrationTabs.tsx b/ts/components/session/RegistrationTabs.tsx index a7fb044db..23840df9a 100644 --- a/ts/components/session/RegistrationTabs.tsx +++ b/ts/components/session/RegistrationTabs.tsx @@ -124,11 +124,12 @@ export class RegistrationTabs extends React.Component<{}, State> { this.accountManager = window.getAccountManager(); // Clean status in case the app closed unexpectedly - window.textsecure.storage.remove('secondaryDeviceStatus'); } public componentDidMount() { this.generateMnemonicAndKeyPair().ignore(); + window.textsecure.storage.remove('secondaryDeviceStatus'); + this.resetRegistration().ignore(); } public render() { @@ -551,8 +552,6 @@ export class RegistrationTabs extends React.Component<{}, State> { } private renderTermsConditionAgreement() { - // FIXME add link to our Terms and Conditions and privacy statement - return (
@@ -893,7 +892,7 @@ export class RegistrationTabs extends React.Component<{}, State> { await this.accountManager.requestPairing(primaryPubKey); const pubkey = window.textsecure.storage.user.getNumber(); const words = window.mnemonic.pubkey_to_secret_words(pubkey); - window.console.log(`Here is your secret:\n${words}`); + // window.console.log(`Here is your secret:\n${words}`); window.pushToast({ title: `${window.i18n('secretPrompt')}`, description: words, diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx index 9660fc0a4..dcd175ac9 100644 --- a/ts/components/session/settings/SessionSettings.tsx +++ b/ts/components/session/settings/SessionSettings.tsx @@ -256,8 +256,8 @@ export class SettingsView extends React.Component { public renderSessionInfo(): JSX.Element { return (
- v{window.versionInfo.version} - {window.versionInfo.commitHash} + v{window.versionInfo.version} + {window.versionInfo.commitHash}
); }