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

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