From 899b2b277b164e6b67f46f37420fe890e6296205 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 3 Jan 2020 19:56:29 +1100 Subject: [PATCH] Finished QR modal --- ts/components/AddServerDialog.tsx | 8 ++--- ts/components/DevicePairingDialog.tsx | 45 ++++++++++++++++----------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/ts/components/AddServerDialog.tsx b/ts/components/AddServerDialog.tsx index b6373455f..57fa9c19e 100644 --- a/ts/components/AddServerDialog.tsx +++ b/ts/components/AddServerDialog.tsx @@ -55,7 +55,7 @@ export class AddServerDialog extends React.Component {
@@ -217,7 +217,7 @@ export class AddServerDialog extends React.Component { 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 { } 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 { ); await serverAPI.findOrCreateChannel(channelId, conversationId); - await conversation.setPublicSource(sslserverURL, channelId); + await conversation.setPublicSource(sslServerURL, channelId); await conversation.setFriendRequestStatus( window.friends.friendRequestStatusEnum.friends ); diff --git a/ts/components/DevicePairingDialog.tsx b/ts/components/DevicePairingDialog.tsx index e855c7374..5b72f9d55 100644 --- a/ts/components/DevicePairingDialog.tsx +++ b/ts/components/DevicePairingDialog.tsx @@ -45,7 +45,7 @@ export class DevicePairingDialog extends React.Component { loading: true, view: 'default', pubKeyRequests: [], - data: [], + data: ['22452653255643252533'], }; } @@ -59,23 +59,30 @@ export class DevicePairingDialog extends React.Component { 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 ( -
-

- {pubKeyInfo.deviceAlias} -
- Pairing Secret:{' '} - {pubKeyInfo.secretWords} -

- {!isFinalItem ?
: null} -
- ); - }); + 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 ( + //
+ //

+ // {pubKeyInfo.deviceAlias} + //
+ // Pairing Secret:{' '} + // {pubKeyInfo.secretWords} + //

+ // {!isFinalItem ?
: null} + //
+ // ); + // }); return ( <> @@ -113,7 +120,7 @@ export class DevicePairingDialog extends React.Component {
) : (
- {renderPairedDevices} + {'renderPairedDevices'}
)}