Merge pull request #1094 from Bilb/link-device-fixes

Link device fixes
pull/1105/head
Mikunj Varsani 6 years ago committed by GitHub
commit 3e3df7717f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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();
});
}

@ -211,6 +211,7 @@ export class DevicePairingDialog extends React.Component<Props, State> {
buttonColor={SessionButtonColor.Danger}
/>
</div>
<SessionSpinner loading={this.state.loading} />
</div>
</SessionModal>
);
@ -370,13 +371,19 @@ export class DevicePairingDialog extends React.Component<Props, State> {
}
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();
}
}

@ -1066,6 +1066,8 @@ export class Message extends React.PureComponent<Props, State> {
selected,
multiSelectMode,
conversationType,
isPublic,
text,
} = this.props;
const { expired, expiring } = this.state;
@ -1088,15 +1090,13 @@ export class Message extends React.PureComponent<Props, State> {
// 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) {

@ -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 (
<div className="session-terms-conditions-agreement">
<SessionHtmlRenderer html={window.i18n('ByUsingThisService...')} />
@ -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,

@ -256,8 +256,8 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
public renderSessionInfo(): JSX.Element {
return (
<div className="session-settings__version-info">
<span>v{window.versionInfo.version}</span>
<span>{window.versionInfo.commitHash}</span>
<span className="text-selectable">v{window.versionInfo.version}</span>
<span className="text-selectable">{window.versionInfo.commitHash}</span>
</div>
);
}

Loading…
Cancel
Save