mirror of
https://github.com/FranP-code/Pomodoro-Timer-with-Clockify-integration.git
synced 2025-10-12 23:52:30 +00:00
minor bugs
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user