From f68e314c532ab0dc78f1685cc249645a55d2afaa Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 9 Aug 2021 15:58:46 +0100 Subject: [PATCH] Temporary fix for credentials not passing --- src/App.tsx | 55 ++++++++++++++++++++-------- src/stylesheets/sass/app.module.sass | 18 +++++++++ 2 files changed, 58 insertions(+), 15 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6d8ded3..189030a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,19 +1,19 @@ -import React, { useEffect, useState } from "react"; -import { ipcRenderer as ipc } from "electron"; import * as Sentry from "@sentry/react"; -import { platform } from "os"; -import { Agent } from "https"; - import axios from "axios"; +import { ipcRenderer as ipc } from "electron"; +import { Agent } from "https"; -import Swagger from "./Swagger"; +import { platform } from "os"; +import React, { useEffect, useState } from "react"; +import discord from "./images/discord.svg"; +import github from "./images/github.svg"; +import Logo from "./images/logo.png"; import Loading from "./Loading"; import appstyles from "./stylesheets/sass/app.module.sass"; -import Logo from "./images/logo.png"; -import discord from "./images/discord.svg"; -import github from "./images/github.svg"; + +import Swagger from "./Swagger"; const reAgent = new Agent({ rejectUnauthorized: false, @@ -31,6 +31,7 @@ const App = (): React.ReactElement => { const [promptAnswer, setPromptAnswer]: any = useState(null); const [status, setStatus]: any = useState("Starting"); const [credentials, setCredentials]: any = useState(); + const [retry, setRetry]: any = useState(0); useEffect(() => { Sentry.init({ @@ -93,6 +94,11 @@ const App = (): React.ReactElement => { }); }, []); + useEffect(() => { + console.log(`Credentials are`); + console.log(credentials); + }); + /** * Check if prompt ever changes if it does then that means the prompt was answered and * do the appropriate action @@ -165,6 +171,11 @@ const App = (): React.ReactElement => { }); }, []); + const onRetry = () => { + setRetry(retry + 1); + ipc.send("FEREADY", ""); + }; + return ( <>
{
- + {credentials && ( + + )} + + {!credentials && ( +
+
+ AN ERROR HAS OCCURRED
+
+ {/* eslint-disable-next-line react/button-has-type */} + +
+ )} ) : (