minor bugs

This commit is contained in:
2021-10-02 10:28:55 -03:00
parent 756ab5cd03
commit fdbd8a1be6
3 changed files with 11 additions and 7 deletions

View File

@@ -178,7 +178,7 @@ const Account = () => {
<div className={actualState === 'API UPLOADED' ? 'disabled' : null}> <div className={actualState === 'API UPLOADED' ? 'disabled' : null}>
<div className="next-step-title"> <div className="next-step-title">
<h1>One more step...</h1> <h1>One more step...</h1>
<h2>Insert your <a href="https://clockify.me/help/faq/where-can-find-api-information">Clockify API</a> here</h2> <h2>Insert your <a href="https://clockify.me/help/faq/where-can-find-api-information" target="_blank">Clockify API</a> here</h2>
</div> </div>
<form <form

View File

@@ -18,6 +18,7 @@ const ClockifyTasksDisplay = (props) => {
const [projectsDone, setProjectsDone] = useState(false) const [projectsDone, setProjectsDone] = useState(false)
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
const [apiAvailable, setApiAvailable] = useState(false)
const getApiKey = async () => { const getApiKey = async () => {
@@ -31,11 +32,9 @@ const ClockifyTasksDisplay = (props) => {
const dataSnap = await getDoc(reference) const dataSnap = await getDoc(reference)
const result = await dataSnap.data() const result = await dataSnap.data()
if (result.keyClockify) { if (result.keyClockify) {
setApiAvailable(true)
await generateArrayOfWorkspaces(result.keyClockify) await generateArrayOfWorkspaces(result.keyClockify)
} }
@@ -71,7 +70,6 @@ const ClockifyTasksDisplay = (props) => {
const getApiKeyReturn = key const getApiKeyReturn = key
const data = await makeRequestWorkspaces(key) const data = await makeRequestWorkspaces(key)
if (data.code !== 1000) { if (data.code !== 1000) {
@@ -166,7 +164,8 @@ const ClockifyTasksDisplay = (props) => {
props.setProjectID(e) props.setProjectID(e)
} }
if (loading && userUID) { if (loading && userUID !== '' && apiAvailable) {
return ( return (
<div className="clockify-tasks-display loading-container"> <div className="clockify-tasks-display loading-container">
<img src={loadingGif} alt=""/> <img src={loadingGif} alt=""/>
@@ -175,6 +174,10 @@ const ClockifyTasksDisplay = (props) => {
} }
if (!apiAvailable) {
return (<div></div>)
}
return ( return (
<> <>
{ {

View File

@@ -38,6 +38,7 @@ const Identify = (props) => {
const uid = response.user.uid const uid = response.user.uid
addNewUserToFirebase(uid) addNewUserToFirebase(uid)
props.history.push('/config-account')
} catch (error) { } catch (error) {