add a qrcode to scan mnemonic/seed in dialog

pull/1528/head
Audric Ackermann 4 years ago
parent 853222d25b
commit 6a998111c7

@ -161,6 +161,14 @@
padding: 20px 0;
font-style: oblique;
}
.qr-image {
transition: $session-transition-duration;
opacity: 10%;
&:hover {
opacity: 100%;
}
}
}
.permissions-popup,
@ -225,7 +233,6 @@
height: 26px;
width: 26px;
border-radius: 50%;
padding-top: 3px;
background-color: $session-color-white;
transition: $session-transition-duration;

@ -6,6 +6,7 @@ import { ToastUtils, UserUtils } from '../../session/utils';
import { DefaultTheme, withTheme } from 'styled-components';
import { PasswordUtil } from '../../util';
import { getPasswordHash } from '../../data/data';
import { QRCode } from 'react-qr-svg';
interface Props {
onClose: any;
@ -113,6 +114,8 @@ class SessionSeedModalInner extends React.Component<Props, State> {
private renderSeedView() {
const i18n = window.i18n;
const bgColor = '#FFFFFF';
const fgColor = '#1B1B1B';
return (
<>
@ -127,7 +130,15 @@ class SessionSeedModalInner extends React.Component<Props, State> {
</i>
</div>
<div className="spacer-lg" />
<div className="qr-image">
<QRCode
value={this.state.recoveryPhrase}
bgColor={bgColor}
fgColor={fgColor}
level="L"
/>
</div>
<div className="spacer-lg" />
<div className="session-modal__button-group">
<SessionButton
text={i18n('copy')}

@ -635,11 +635,13 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
conversationId: this.id,
});
}
public async sendMessageJob(message: MessageModel) {
public async sendMessageJob(
message: MessageModel,
expireTimer: number | undefined
) {
try {
const uploads = await message.uploadData();
const { id } = message;
const expireTimer = this.get('expireTimer');
const destination = this.id;
const sentAt = message.get('sent_at');
@ -809,9 +811,8 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
await model.saveErrors([error]);
return null;
}
this.queueJob(async () => {
await this.sendMessageJob(model);
await this.sendMessageJob(model, expireTimer);
});
return null;
}

Loading…
Cancel
Save