Finished QR modal

pull/714/head
Vincent 6 years ago
parent 53555c0133
commit 899b2b277b

@ -55,7 +55,7 @@ export class AddServerDialog extends React.Component<Props, State> {
<input <input
type="text" type="text"
id="server-url" id="server-url"
placeholder={i18n('serverURL')} placeholder={i18n('serverUrl')}
defaultValue={this.state.serverURL} defaultValue={this.state.serverURL}
/> />
<div className="spacer-sm" /> <div className="spacer-sm" />
@ -217,7 +217,7 @@ export class AddServerDialog extends React.Component<Props, State> {
const rawserverURL = serverURL const rawserverURL = serverURL
.replace(/^https?:\/\//i, '') .replace(/^https?:\/\//i, '')
.replace(/[/\\]+$/i, ''); .replace(/[/\\]+$/i, '');
const sslserverURL = `https://${rawserverURL}`; const sslServerURL = `https://${rawserverURL}`;
const conversationId = `publicChat:${channelId}@${rawserverURL}`; const conversationId = `publicChat:${channelId}@${rawserverURL}`;
const conversationExists = window.ConversationController.get( const conversationExists = window.ConversationController.get(
@ -231,7 +231,7 @@ export class AddServerDialog extends React.Component<Props, State> {
} }
const serverAPI = await window.lokiPublicChatAPI.findOrCreateServer( const serverAPI = await window.lokiPublicChatAPI.findOrCreateServer(
sslserverURL sslServerURL
); );
if (!serverAPI) { if (!serverAPI) {
// Url incorrect or server not compatible // Url incorrect or server not compatible
@ -246,7 +246,7 @@ export class AddServerDialog extends React.Component<Props, State> {
); );
await serverAPI.findOrCreateChannel(channelId, conversationId); 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
); );

@ -45,7 +45,7 @@ export class DevicePairingDialog extends React.Component<Props, State> {
loading: true, loading: true,
view: 'default', view: 'default',
pubKeyRequests: [], pubKeyRequests: [],
data: [], data: ['22452653255643252533'],
}; };
} }
@ -59,23 +59,30 @@ export class DevicePairingDialog extends React.Component<Props, State> {
const waitingForRequest = this.state.view === 'waitingForRequest'; const waitingForRequest = this.state.view === 'waitingForRequest';
const nothingPaired = this.state.data.length === 0; const nothingPaired = this.state.data.length === 0;
const renderPairedDevices = this.state.data.map((pubKey: any) => { console.log(this.state);
const pubKeyInfo = this.getPubkeyName(pubKey); console.log(this.state);
const isFinalItem = console.log(this.state);
this.state.data[this.state.data.length - 1] === pubKey; console.log(this.state);
console.log(this.state);
return (
<div key={pubKey}> console.log('dAAVIHN');
<p> // const renderPairedDevices = this.state.data.map((pubKey: any) => {
{pubKeyInfo.deviceAlias} // const pubKeyInfo = this.getPubkeyName(pubKey);
<br /> // const isFinalItem =
<span className="text-subtle">Pairing Secret:</span>{' '} // this.state.data[this.state.data.length - 1] === pubKey;
{pubKeyInfo.secretWords}
</p> // return (
{!isFinalItem ? <hr className="text-soft fullwidth" /> : null} // <div key={pubKey}>
</div> // <p>
); // {pubKeyInfo.deviceAlias}
}); // <br />
// <span className="text-subtle">Pairing Secret:</span>{' '}
// {pubKeyInfo.secretWords}
// </p>
// {!isFinalItem ? <hr className="text-soft fullwidth" /> : null}
// </div>
// );
// });
return ( return (
<> <>
@ -113,7 +120,7 @@ export class DevicePairingDialog extends React.Component<Props, State> {
</div> </div>
) : ( ) : (
<div className="session-modal__centered"> <div className="session-modal__centered">
{renderPairedDevices} {'renderPairedDevices'}
</div> </div>
)} )}

Loading…
Cancel
Save