Finished QR modal

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

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

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

Loading…
Cancel
Save