Merge pull request #760 from vincentbavitz/clearnet

Keyboard navigation and local rebase
pull/768/head
Vince 5 years ago committed by GitHub
commit a45c4428c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,7 @@ yarn install --frozen-lockfile # Install and build dependencies (this will take
yarn grunt # Generate final JS and CSS assets
yarn icon-gen # Generate full set of icons for Electron
yarn test # A good idea to make sure tests run first
yarn start # Start Session Messenger!
yarn start # Start Session!
```
You'll need to restart the application regularly to see your changes, as there
@ -84,7 +84,7 @@ yarn grunt dev # runs until you stop it, re-generating built assets on file chan
## Additional storage profiles
Since there is no registration for Session Messenger, you can create as many accounts as you
Since there is no registration for Session, you can create as many accounts as you
can public keys. To test the P2P functionality on the same machine, however, requries
that each client binds their message server to a different port.

@ -1,8 +1,8 @@
# Session Messenger
# Session
[![Build Status](https://travis-ci.org/loki-project/loki-messenger.svg?branch=development)](https://travis-ci.org/loki-project/loki-messenger)
Session Messenger allows for truly decentralized, end to end, and private encrypted chats. Session Messenger is built to handle both online and fully Asynchronous offline messages. Loki messenger implements the Signal protocol for message encryption. Our Client interface is a fork of [Signal Messenger](https://signal.org/). All communication that passes through Loki messenger is routed through [Lokinet](https://github.com/loki-project/loki-network).
Session allows for truly decentralized, end to end, and private encrypted chats. Session is built to handle both online and fully Asynchronous offline messages. Loki messenger implements the Signal protocol for message encryption. Our Client interface is a fork of [Signal Messenger](https://signal.org/). All communication that passes through Loki messenger is routed through [Lokinet](https://github.com/loki-project/loki-network).
## Summary
@ -14,11 +14,11 @@ If Alice and Bob are both online they can simply resolve each others public keys
**Offline messages**
Offline messaging uses Swarms, given any users public key the user can resolve a public key to a specific grouping of Service Nodes (AKA Swarm) each user in Session Messenger belongs to a Swarm. When routing a message offline the user selects a Service node in the destination users Swarm, when the user comes online they query any node in their Swarm, if the Swarm is holding any messages for the user they disseminate those messages to the user.
Offline messaging uses Swarms, given any users public key the user can resolve a public key to a specific grouping of Service Nodes (AKA Swarm) each user in Session belongs to a Swarm. When routing a message offline the user selects a Service node in the destination users Swarm, when the user comes online they query any node in their Swarm, if the Swarm is holding any messages for the user they disseminate those messages to the user.
![Swarm Messaging](https://i.imgur.com/o13Knds.png)
Spam protections for Session Messenger are based on a Proof of Work which is attached to any message that exceeds a default size or Time To Live, this process is discussed further in the [Loki whitepaper](https://loki.network/whitepaper).
Spam protections for Session are based on a Proof of Work which is attached to any message that exceeds a default size or Time To Live, this process is discussed further in the [Loki whitepaper](https://loki.network/whitepaper).
## Want to Contribute? Found a Bug or Have a feature request?

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Opustit Session Messenger",
"message": "Opustit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -66,7 +66,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {
@ -265,7 +265,7 @@
"Header shown on the screen at the end of a successful import process"
},
"importCompleteStartButton": {
"message": "Start using Session Messenger",
"message": "Start using Session",
"description":
"Button shown at end of successful import process, nothing left but a restart"
},
@ -295,6 +295,9 @@
}
}
},
"capsLockOn": {
"message": "Caps lock is on."
},
"me": {
"message": "Me",
"description": "The label for yourself when shown in a group member list"
@ -719,12 +722,12 @@
"Item under the Help menu, takes you to GitHub new issue form (title case)"
},
"signalDesktopPreferences": {
"message": "Session Messenger Preferences",
"message": "Session Preferences",
"description":
"Title of the window that pops up with Signal Desktop preferences in it"
},
"aboutSignalDesktop": {
"message": "About Session Messenger",
"message": "About Session",
"description": "Item under the Help menu, which opens a small about window"
},
"speech": {
@ -745,7 +748,7 @@
"description": "Command in the tray icon menu, to quit the application"
},
"lokiMessenger": {
"message": "Session Messenger"
"message": "Session"
},
"search": {
"message": "Search",
@ -895,7 +898,7 @@
},
"audioPermissionNeeded": {
"message":
"To send audio messages, allow Session Messenger to access your microphone.",
"To send audio messages, allow Session to access your microphone.",
"description":
"Shown if the user attempts to send an audio message without audio permssions turned on"
},
@ -1093,7 +1096,7 @@
"Placeholder text in the message entry field when it is disabled while we are waiting for a friend request approval"
},
"sendMessageFriendRequest": {
"message": "Hi there! This is <insert name here> !",
"message": "Hi there! This is ...!",
"description":
"Placeholder text in the message entry field when it is the first message sent to that contact"
},
@ -1169,7 +1172,7 @@
"Confirmation dialog title that asks the user if they really wish to delete a public channel. Answer buttons use the strings 'ok' and 'cancel'. The deletion is permanent, i.e. it cannot be undone."
},
"deletePublicChannelConfirmation": {
"message": "Leave this public channel?",
"message": "Leave this Open Group?",
"description":
"Confirmation dialog text that tells the user what will happen if they leave the public channel."
},
@ -1212,7 +1215,7 @@
"This is a past tense, informational message. In other words, your secure session has been reset."
},
"betaDisclaimerTitle": {
"message": "Thanks for using Session Messenger!",
"message": "Thanks for using Session!",
"description": "Title for beta disclaimer modal"
},
"betaDisclaimerSubtitle": {
@ -1273,7 +1276,7 @@
}
},
"installWelcome": {
"message": "Welcome to Session Messenger",
"message": "Welcome to Session",
"description": "Welcome title on the install page"
},
"installTagline": {
@ -1282,12 +1285,12 @@
"Tagline displayed under 'installWelcome' string on the install page"
},
"linkYourPhone": {
"message": "Link your phone to Session Messenger",
"message": "Link your phone to Session",
"description":
"Shown on the front page when the application first starst, above the QR code"
},
"signalSettings": {
"message": "Session Messenger Settings",
"message": "Session Settings",
"description":
"Used in the guidance to help people find the 'link new device' area of their Signal mobile app"
},
@ -1507,7 +1510,7 @@
},
"expiredWarning": {
"message":
"This version of Session Messenger has expired. Please upgrade to the latest version to continue messaging.",
"This version of Session has expired. Please upgrade to the latest version to continue messaging.",
"description":
"Warning notification that this version of the app has expired"
},

@ -36,7 +36,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -52,7 +52,7 @@
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Session Messenger",
"message": "Quit Session",
"description": "Application menu command to close the application"
},
"editMenuUndo": {

@ -902,7 +902,7 @@ async function updateToLokiSchemaVersion1(currentVersion, instance) {
rssFeed: 'https://loki.network/feed/',
closable: true,
name: 'Loki.network News',
profileAvatar: 'images/loki/loki_icon.png',
profileAvatar: 'images/loki/session_icon.png',
};
const updatesRssFeedData = {
@ -911,7 +911,7 @@ async function updateToLokiSchemaVersion1(currentVersion, instance) {
rssFeed: 'https://loki.network/category/messenger-updates/feed/',
closable: false,
name: 'Messenger updates',
profileAvatar: 'images/loki/loki_icon.png',
profileAvatar: 'images/loki/session_icon.png',
};
const autoJoinLokiChats = false;

@ -19,7 +19,7 @@
script-src 'self';
style-src 'self' 'unsafe-inline';"
>
<title>Session Messenger</title>
<title>Session</title>
<link href='images/loki/loki_icon_128.png' rel='shortcut icon'>
<link href="stylesheets/manifest.css" rel="stylesheet" type="text/css" />

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

@ -122,7 +122,7 @@
'x_white.svg',
'icon-paste.svg',
'loki/loki_icon_text.png',
'loki/loki_icon_128.png',
'loki/session_icon_128.png',
]);
// Set server-client time difference

@ -6,7 +6,7 @@ const got = require('got');
const BASE_URL = 'https://debuglogs.org';
const VERSION = window.getVersion();
const USER_AGENT = `Session Messenger ${VERSION}`;
const USER_AGENT = `Session ${VERSION}`;
// Workaround: Submitting `FormData` using native `FormData::submit` procedure
// as integration with `got` results in S3 error saying we havent set the

@ -222,7 +222,7 @@ function _promiseAjax(providedUrl, options) {
method: options.type,
body: options.data || null,
headers: {
'User-Agent': 'Session Messenger',
'User-Agent': 'Session',
'X-Loki-Messenger-Agent': 'OWD',
...options.headers,
},

@ -108,7 +108,7 @@
const last = this.last().toJSON();
switch (userSetting) {
case SettingNames.COUNT:
title = 'Session Messenger';
title = 'Session';
if (last.isFriendRequest) {
message = `Friend request ${last.friendRequestType}`;

@ -1738,8 +1738,12 @@
if (event.key !== 'Escape') {
return;
}
// TODO: this view is not always in focus (e.g. after I've selected a message),
// so need to make Esc more robust
// Perhaps look into ConversationHeader.tsx and add an event listener in there.
// Up and down arrows should scroll
// Alt + up and down should swap between conversations / setting categories
this.model.resetMessageSelection();
this.closeEmojiPanel();
},

@ -75,7 +75,7 @@ describe('Snode Channel', () => {
});
it('should encrypt data correctly', async () => {
// message sent by Session Messenger
// message sent by Session
const snode = await generateSnodeKeysAndAddress();
const messageSent = 'I am Groot';
const textEncoder = new TextEncoder();
@ -133,7 +133,7 @@ describe('Snode Channel', () => {
const encryptedBase64 = dcodeIO.ByteBuffer.wrap(encrypted).toString(
'base64'
);
// message received by Session Messenger
// message received by Session
const decrypted = await channel.decrypt(snode.address, encryptedBase64);
assert.strictEqual(messageSent, decrypted);
});

@ -308,7 +308,7 @@ OutgoingMessage.prototype = {
return Promise.all(
devicesPubKeys.map(async devicePubKey => {
// Session Messenger doesn't use the deviceId scheme, it's always 1.
// Session doesn't use the deviceId scheme, it's always 1.
// Instead, there are multiple device public keys.
const deviceId = 1;
const updatedDevices = await this.getStaleDeviceIdsForNumber(

@ -1,9 +1,9 @@
{
"name": "session-messenger-desktop",
"productName": "Session Messenger",
"productName": "Session",
"description": "Private messaging from your desktop",
"repository": "https://github.com/loki-project/loki-messenger.git",
"version": "1.0.0-beta10",
"version": "1.0.0",
"license": "GPL-3.0",
"author": {
"name": "Loki Project",
@ -240,7 +240,7 @@
"linux": {
"category": "Network",
"desktop": {
"StartupWMClass": "Session Messenger"
"StartupWMClass": "Session"
},
"asarUnpack": "node_modules/spellchecker/vendor/hunspell_dictionaries",
"target": [

@ -27,16 +27,16 @@ const PRODUCTION_NAME = 'loki-messenger-desktop';
const BETA_NAME = 'loki-messenger-desktop-beta';
const PRODUCT_NAME_PATH = 'productName';
const PRODUCTION_PRODUCT_NAME = 'Session Messenger';
const BETA_PRODUCT_NAME = 'Session Messenger Beta';
const PRODUCTION_PRODUCT_NAME = 'Session';
const BETA_PRODUCT_NAME = 'Session Beta';
const APP_ID_PATH = 'build.appId';
const PRODUCTION_APP_ID = 'com.loki-project.messenger-desktop';
const BETA_APP_ID = 'com.loki-project.messenger-desktop-beta';
const STARTUP_WM_CLASS_PATH = 'build.linux.desktop.StartupWMClass';
const PRODUCTION_STARTUP_WM_CLASS = 'Session Messenger';
const BETA_STARTUP_WM_CLASS = 'Session Messenger Beta';
const PRODUCTION_STARTUP_WM_CLASS = 'Session';
const BETA_STARTUP_WM_CLASS = 'Session Beta';
// -------

@ -1469,6 +1469,7 @@
}
.module-conversation-header__avatar {
cursor: pointer;
min-width: 28px;
user-select: none;
}
@ -1735,6 +1736,7 @@
// Module: Document List Item
.module-document-list-item {
padding-right: 10px;
width: 100%;
height: 72px;
}
@ -2595,7 +2597,7 @@
.module-typing-animation {
display: inline-flex;
flex-directin: row;
flex-direction: row;
align-items: center;
height: 8px;

@ -476,6 +476,12 @@ $session-element-border-green: 4px solid $session-color-green;
width: 100%;
display: flex;
&-text {
@include session-color-subtle($session-color-white);
font-family: 'SF Pro Text';
font-weight: 300;
}
.module-contact-name {
width: 100%;
}
@ -1277,6 +1283,10 @@ label {
}
}
.dark-theme .bottom-bar .send-message[disabled='disabled'] {
background: $session-shade-4 !important;
}
.session-radio-group fieldset {
border: none;
margin-left: $session-margin-sm;
@ -1325,15 +1335,16 @@ label {
}
.session-id-editable {
resize: none;
overflow: hidden;
}
padding: $session-margin-lg;
.user-details-dialog {
.session-id-editable {
textarea {
width: 30vh;
}
}
.session-id-editable textarea {
resize: none;
overflow: hidden;
}
input {
user-select: text;

@ -79,8 +79,15 @@
}
.module-attachment-section__items {
display: grid;
grid-template-columns: repeat(3, 1fr);
&-media {
display: grid;
grid-template-columns: repeat(3, 1fr);
width: 100%;
}
&-documents {
width: 100%;
}
}
.module-media {

@ -296,7 +296,7 @@ $session-compose-margin: 20px;
margin: 0px 20px;
}
.session-id-editable {
.session-id-editable textarea::-webkit-inner-spin-button {
margin: 0px 20px;
width: -webkit-fill-available;
flex-shrink: 0;
@ -362,6 +362,7 @@ $session-compose-margin: 20px;
height: inherit;
border: none;
flex-grow: 1;
font-size: $session-font-md;
&:focus {
outline: none !important;

@ -224,22 +224,30 @@
}
&-id-editable {
display: flex;
align-items: center;
justify-content: center;
height: 94px;
width: 100%;
padding: 20px;
border-radius: 8px;
border: 2px solid $session-color-dark-grey;
outline: 0;
background: transparent;
color: $session-color-white;
font-size: 15px;
line-height: 18px;
text-align: center;
border: 2px solid #353535;
margin-bottom: 20px;
overflow-wrap: break-word;
padding: 20px 5px 20px 5px;
display: inline-block;
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
user-select: all;
textarea {
width: 100%;
outline: 0;
border: none;
background: transparent;
color: #fff;
font-size: 15px;
line-height: 18px;
text-align: center;
overflow-wrap: break-word;
padding: 20px 5px 20px 5px;
display: inline-block;
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
user-select: all;
}
}
}

@ -1,9 +1,9 @@
[
{
"label": "Session Messenger",
"label": "Session",
"submenu": [
{
"label": "About Session Messenger",
"label": "About Session",
"click": null
},
{
@ -28,7 +28,7 @@
"type": "separator"
},
{
"label": "Quit Session Messenger",
"label": "Quit Session",
"role": "quit"
}
]

@ -1,9 +1,9 @@
[
{
"label": "Session Messenger",
"label": "Session",
"submenu": [
{
"label": "About Session Messenger",
"label": "About Session",
"click": null
},
{
@ -28,7 +28,7 @@
"type": "separator"
},
{
"label": "Quit Session Messenger",
"label": "Quit Session",
"role": "quit"
}
]

@ -17,7 +17,7 @@
"type": "separator"
},
{
"label": "Quit Session Messenger",
"label": "Quit Session",
"role": "quit"
}
]
@ -134,7 +134,7 @@
"type": "separator"
},
{
"label": "About Session Messenger",
"label": "About Session",
"click": null
}
]

@ -6,7 +6,7 @@
"type": "separator"
},
{
"label": "Quit Session Messenger",
"label": "Quit Session",
"role": "quit"
}
]
@ -123,7 +123,7 @@
"type": "separator"
},
{
"label": "About Session Messenger",
"label": "About Session",
"click": null
}
]

@ -146,15 +146,15 @@
<div class="content">
<div class="betaDisclaimerView" style="display: none;">
<h2>
Thanks for testing Session Messenger!
Thanks for testing Session!
</h2>
<p>
Thanks for testing Session Messenger! This software is a beta version of the full Session Messenger software suite, and so is missing some of the features the full version will have.
Thanks for testing Session! This software is a beta version of the full Session software suite, and so is missing some of the features the full version will have.
</p>
<p>
<b>
This version of Session Messenger provides no guarantees of metadata privacy.
This version of Session provides no guarantees of metadata privacy.
</b>
</p>
@ -167,7 +167,7 @@
</p>
<p>
However, no one except you and your intended recipients will be able to see the contents of your messages. We recommend using existing methods, like Tor or I2P to mask your IP address while using Session Messenger beta version.
However, no one except you and your intended recipients will be able to see the contents of your messages. We recommend using existing methods, like Tor or I2P to mask your IP address while using Session beta version.
</p>
<p>

@ -23,7 +23,7 @@ export class GroupInvitation extends React.Component<Props> {
<div className="contents">
<img
alt="group-avatar"
src="images/loki/loki_icon.png"
src="images/loki/session_icon.png"
className="invite-group-avatar"
/>
<span className="group-details">

@ -16,10 +16,14 @@ interface Props {
export class AttachmentSection extends React.Component<Props> {
public render() {
const { type } = this.props;
return (
<div className="module-attachment-section">
<div className="module-attachment-section__items">
{this.renderItems()}
<div className={`module-attachment-section__items-${type}`}>
{this.renderItems()}
</div>
</div>
</div>
);

@ -28,16 +28,17 @@ export class SessionIdEditable extends React.PureComponent<Props> {
const { placeholder, editable, text } = this.props;
return (
<textarea
ref={this.inputRef}
className="session-id-editable"
placeholder={placeholder}
disabled={!editable}
spellCheck={false}
onKeyDown={this.handleKeyDown}
onChange={this.handleChange}
value={text}
/>
<div className="session-id-editable">
<textarea
ref={this.inputRef}
placeholder={placeholder}
disabled={!editable}
spellCheck={false}
onKeyDown={this.handleKeyDown}
onChange={this.handleChange}
value={text}
/>
</div>
);
}

@ -31,6 +31,12 @@ export class SessionPasswordModal extends React.Component<Props, State> {
this.setPassword = this.setPassword.bind(this);
this.closeDialog = this.closeDialog.bind(this);
this.onKeyUp = this.onKeyUp.bind(this);
}
public componentDidMount() {
setTimeout(() => $('#password-modal-input').focus(), 100);
}
public render() {
@ -58,6 +64,7 @@ export class SessionPasswordModal extends React.Component<Props, State> {
type="password"
id="password-modal-input"
placeholder={placeholders[0]}
onKeyUp={this.onKeyUp}
maxLength={window.CONSTANTS.MAX_PASSWORD_LENGTH}
/>
{action !== PasswordAction.Remove && (
@ -65,6 +72,7 @@ export class SessionPasswordModal extends React.Component<Props, State> {
type="password"
id="password-modal-input-confirm"
placeholder={placeholders[1]}
onKeyUp={this.onKeyUp}
maxLength={window.CONSTANTS.MAX_PASSWORD_LENGTH}
/>
)}
@ -182,4 +190,14 @@ export class SessionPasswordModal extends React.Component<Props, State> {
this.props.onClose();
}
}
private async onKeyUp(event: any) {
const { onOk } = this.props;
if (event.key === 'Enter') {
await this.setPassword(onOk);
}
event.preventDefault();
}
}

@ -27,8 +27,10 @@ export class SessionPasswordPrompt extends React.PureComponent<{}, State> {
this.onKeyUp = this.onKeyUp.bind(this);
this.initLogin = this.initLogin.bind(this);
this.initClearDataView = this.initClearDataView.bind(this);
}
window.addEventListener('keyup', this.onKeyUp);
public componentDidMount() {
setTimeout(() => $('#password-prompt-input').focus(), 100);
}
public render() {
@ -56,9 +58,9 @@ export class SessionPasswordPrompt extends React.PureComponent<{}, State> {
<input
id="password-prompt-input"
type="password"
autoFocus={true}
defaultValue=""
placeholder={' '}
onKeyUp={this.onKeyUp}
maxLength={window.CONSTANTS.MAX_PASSWORD_LENGTH}
/>
);

@ -36,8 +36,10 @@ export class SessionSeedModal extends React.Component<Props, State> {
this.confirmPassword = this.confirmPassword.bind(this);
this.checkHasPassword = this.checkHasPassword.bind(this);
this.onEnter = this.onEnter.bind(this);
}
window.addEventListener('keyup', this.onEnter);
public componentDidMount() {
setTimeout(() => $('#seed-input-password').focus(), 100);
}
public render() {
@ -84,6 +86,7 @@ export class SessionSeedModal extends React.Component<Props, State> {
type="password"
id="seed-input-password"
placeholder={i18n('password')}
onKeyUp={this.onEnter}
maxLength={maxPasswordLen}
/>
@ -218,9 +221,7 @@ export class SessionSeedModal extends React.Component<Props, State> {
private onEnter(event: any) {
if (event.key === 'Enter') {
if ($('#seed-input-password').is(':focus')) {
this.confirmPassword();
}
this.confirmPassword();
}
}
}

@ -68,9 +68,14 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
this.hasPassword();
this.refreshLinkedDevice = this.refreshLinkedDevice.bind(this);
this.onKeyUp = this.onKeyUp.bind(this);
window.addEventListener('keyup', this.onKeyUp);
}
public componentDidMount() {
setTimeout(() => $('#password-lock-input').focus(), 100);
window.Whisper.events.on('refreshLinkedDeviceList', async () => {
setTimeout(() => {
this.refreshLinkedDevice();
@ -398,7 +403,7 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
id: 'media-permissions',
title: window.i18n('mediaPermissionsTitle'),
description: window.i18n('mediaPermissionsDescription'),
hidden: true, // Hidden until feature works
hidden: false,
type: SessionSettingType.Toggle,
category: SessionSettingCategory.Permissions,
setFn: window.toggleMediaPermissions,
@ -576,4 +581,14 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
});
});
}
private async onKeyUp(event: any) {
const lockPasswordFocussed = $('#password-lock-input').is(':focus');
if (event.key === 'Enter' && lockPasswordFocussed) {
await this.validatePasswordLock();
}
event.preventDefault();
}
}

Loading…
Cancel
Save