pull/461/head
Mikunj 6 years ago
parent 3d179909c7
commit 21dad58537

@ -1922,8 +1922,7 @@
}, },
"showQRCode": { "showQRCode": {
"message": "Show QR code", "message": "Show QR code",
"description": "description": "Button action that the user can click to view their QR code"
"Button action that the user can click to view their QR code"
}, },
"seedViewTitle": { "seedViewTitle": {

@ -14,9 +14,7 @@
initialize(options = {}) { initialize(options = {}) {
this.okText = options.okText || i18n('ok'); this.okText = options.okText || i18n('ok');
this.render(); this.render();
this.$('.qr-dialog').bind('keyup', event => this.$('.qr-dialog').bind('keyup', event => this.onKeyup(event));
this.onKeyup(event)
);
if (options.string) { if (options.string) {
this.qr = new QRCode(this.$('#qr')[0], { this.qr = new QRCode(this.$('#qr')[0], {

@ -402,16 +402,16 @@ window.Signal.Logs = require('./js/modules/logs');
// Add right-click listener for selected text and urls // Add right-click listener for selected text and urls
const contextMenu = require('electron-context-menu'); const contextMenu = require('electron-context-menu');
const isQR = (params) => params.mediaType === 'image' && params.titleText === 'Scan me!'; const isQR = params =>
params.mediaType === 'image' && params.titleText === 'Scan me!';
// QR saving doesn't work so we just disable it // QR saving doesn't work so we just disable it
contextMenu({ contextMenu({
showInspectElement: false, showInspectElement: false,
shouldShowMenu: (event, params) => { shouldShowMenu: (event, params) => {
const isRegular = params.mediaType === 'none' && (params.linkURL || params.selectionText); const isRegular =
return Boolean( params.mediaType === 'none' && (params.linkURL || params.selectionText);
!params.isEditable && (isQR(params) || isRegular) return Boolean(!params.isEditable && (isQR(params) || isRegular));
)
}, },
menu: (actions, params) => { menu: (actions, params) => {
// If it's not a QR then show the default options // If it's not a QR then show the default options

@ -862,7 +862,6 @@ $loading-height: 16px;
} }
.qr-dialog { .qr-dialog {
.content { .content {
width: 300px !important; width: 300px !important;
max-width: none !important; max-width: none !important;

@ -333,7 +333,7 @@ export class MainHeader extends React.Component<Props, any> {
onClick: () => { onClick: () => {
trigger('showQRDialog'); trigger('showQRDialog');
}, },
} },
]; ];
const passItem = (type: string) => ({ const passItem = (type: string) => ({

Loading…
Cancel
Save