Merge pull request #744 from Bilb/various-redesign-changes

Various redesign changes
pull/746/head
Maxim Shishmarev 5 years ago committed by GitHub
commit 82e1f53f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1412,10 +1412,18 @@
"message": "Enable the sending and receiving of read receipts", "message": "Enable the sending and receiving of read receipts",
"description": "Description of the read receipts setting" "description": "Description of the read receipts setting"
}, },
"readReceiptSettingTitle": {
"message": "Read Receipts",
"description": "Title of the read receipts setting"
},
"typingIndicatorsSettingDescription": { "typingIndicatorsSettingDescription": {
"message": "Enable the sending and receiving of typing indicators", "message": "Enable the sending and receiving of typing indicators",
"description": "Description of the typing indicators setting" "description": "Description of the typing indicators setting"
}, },
"typingIndicatorsSettingTitle": {
"message": "Typing Indicators",
"description": "Title of the typing indicators setting"
},
"messageTTL": { "messageTTL": {
"message": "Message TTL", "message": "Message TTL",
"description": "Title of the Message TTL setting" "description": "Title of the Message TTL setting"

@ -1351,7 +1351,6 @@ class LokiPublicChannelAPI {
// process remaining messages // process remaining messages
slaveMessages.forEach(messageData => { slaveMessages.forEach(messageData => {
const slaveKey = messageData.source; const slaveKey = messageData.source;
// prevent our own device sent messages from coming back in // prevent our own device sent messages from coming back in
@ -1377,7 +1376,6 @@ class LokiPublicChannelAPI {
this.chatAPI.emit('publicMessage', { this.chatAPI.emit('publicMessage', {
message: messageData, message: messageData,
}); });
}); });
// if we received one of our own messages // if we received one of our own messages

@ -187,8 +187,8 @@ function captureClicks(window) {
const DEFAULT_WIDTH = 800; const DEFAULT_WIDTH = 800;
const DEFAULT_HEIGHT = 710; const DEFAULT_HEIGHT = 710;
const MIN_WIDTH = 640; const MIN_WIDTH = 1125;
const MIN_HEIGHT = 360; const MIN_HEIGHT = 750;
const BOUNDS_BUFFER = 100; const BOUNDS_BUFFER = 100;
function isVisible(window, bounds) { function isVisible(window, bounds) {

@ -36,6 +36,7 @@
width: inherit; width: inherit;
color: $session-color-white; color: $session-color-white;
text-align: center; text-align: center;
display: none;
} }
&-item { &-item {

@ -178,6 +178,7 @@ $session-compose-margin: 20px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin: 15px 7px 14px 0px; margin: 15px 7px 14px 0px;
height: 33px;
@at-root .light-theme #{&} { @at-root .light-theme #{&} {
background-color: $session-color-white; background-color: $session-color-white;

@ -392,9 +392,10 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
} }
private async attemptConnection(serverURL: string, channelId: number) { private async attemptConnection(serverURL: string, channelId: number) {
const rawserverURL = serverURL let rawserverURL = serverURL
.replace(/^https?:\/\//i, '') .replace(/^https?:\/\//i, '')
.replace(/[/\\]+$/i, ''); .replace(/[/\\]+$/i, '');
rawserverURL = rawserverURL.toLowerCase();
const sslServerURL = `https://${rawserverURL}`; const sslServerURL = `https://${rawserverURL}`;
const conversationId = `publicChat:${channelId}@${rawserverURL}`; const conversationId = `publicChat:${channelId}@${rawserverURL}`;
@ -423,12 +424,13 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
'group' 'group'
); );
await serverAPI.findOrCreateChannel(channelId, conversationId);
await conversation.setPublicSource(sslServerURL, channelId); await conversation.setPublicSource(sslServerURL, channelId);
await conversation.setFriendRequestStatus( await conversation.setFriendRequestStatus(
window.friends.friendRequestStatusEnum.friends window.friends.friendRequestStatusEnum.friends
); );
conversation.getPublicSendData(); // may want "await" if you want to use the API
return conversation; return conversation;
} }
} }

@ -217,11 +217,11 @@ export class RegistrationTabs extends React.Component<{}, State> {
private onDisplayNameChanged(val: string) { private onDisplayNameChanged(val: string) {
const sanitizedName = this.sanitiseNameInput(val); const sanitizedName = this.sanitiseNameInput(val);
const trimName = sanitizedName.trim();
this.setState({ this.setState({
displayName: sanitizedName, displayName: sanitizedName,
displayNameError: !sanitizedName displayNameError: !trimName ? window.i18n('displayNameEmpty') : undefined,
? window.i18n('displayNameEmpty')
: undefined,
}); });
} }
@ -553,10 +553,7 @@ export class RegistrationTabs extends React.Component<{}, State> {
} }
private renderTermsConditionAgreement() { private renderTermsConditionAgreement() {
// FIXME // FIXME add link to our Terms and Conditions and privacy statement
window.log.info(
'FIXME: add link to our Terms and Conditions and privacy statement'
);
return ( return (
<div className="session-terms-conditions-agreement"> <div className="session-terms-conditions-agreement">
@ -713,7 +710,7 @@ export class RegistrationTabs extends React.Component<{}, State> {
} }
private sanitiseNameInput(val: string) { private sanitiseNameInput(val: string) {
return val.trim().replace(window.displayNameRegex, ''); return val.replace(window.displayNameRegex, '');
} }
private async resetRegistration() { private async resetRegistration() {
@ -738,6 +735,19 @@ export class RegistrationTabs extends React.Component<{}, State> {
passwordFieldsMatch, passwordFieldsMatch,
} = this.state; } = this.state;
// Make sure the password is valid // Make sure the password is valid
const trimName = displayName.trim();
if (!trimName) {
window.pushToast({
title: window.i18n('displayNameEmpty'),
type: 'error',
id: 'invalidDisplayName',
});
return;
}
if (passwordErrorString) { if (passwordErrorString) {
window.pushToast({ window.pushToast({
title: window.i18n('invalidPassword'), title: window.i18n('invalidPassword'),
@ -761,9 +771,6 @@ export class RegistrationTabs extends React.Component<{}, State> {
if (!mnemonicSeed) { if (!mnemonicSeed) {
return; return;
} }
if (!displayName) {
return;
}
// Ensure we clear the secondary device registration status // Ensure we clear the secondary device registration status
window.textsecure.storage.remove('secondaryDeviceStatus'); window.textsecure.storage.remove('secondaryDeviceStatus');
@ -775,7 +782,7 @@ export class RegistrationTabs extends React.Component<{}, State> {
await this.accountManager.registerSingleDevice( await this.accountManager.registerSingleDevice(
mnemonicSeed, mnemonicSeed,
language, language,
displayName trimName
); );
trigger('openInbox'); trigger('openInbox');
} catch (e) { } catch (e) {

@ -406,6 +406,30 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
defaultValue: 24, defaultValue: 24,
}, },
}, },
{
id: 'read-receipt-setting',
title: window.i18n('readReceiptSettingTitle'),
description: window.i18n('readReceiptSettingDescription'),
hidden: false,
type: SessionSettingType.Toggle,
category: SessionSettingCategory.Privacy,
setFn: undefined,
comparisonValue: undefined,
onClick: undefined,
content: {},
},
{
id: 'typing-indicators-setting',
title: window.i18n('typingIndicatorsSettingTitle'),
description: window.i18n('typingIndicatorsSettingDescription'),
hidden: false,
type: SessionSettingType.Toggle,
category: SessionSettingCategory.Privacy,
setFn: undefined,
comparisonValue: undefined,
onClick: undefined,
content: {},
},
{ {
id: 'set-password', id: 'set-password',
title: window.i18n('setAccountPasswordTitle'), title: window.i18n('setAccountPasswordTitle'),

Loading…
Cancel
Save