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:
@@ -178,7 +178,7 @@ const Account = () => {
|
||||
<div className={actualState === 'API UPLOADED' ? 'disabled' : null}>
|
||||
<div className="next-step-title">
|
||||
<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>
|
||||
|
||||
<form
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
{
|
||||
|
||||
@@ -38,6 +38,7 @@ const Identify = (props) => {
|
||||
const uid = response.user.uid
|
||||
|
||||
addNewUserToFirebase(uid)
|
||||
props.history.push('/config-account')
|
||||
|
||||
} catch (error) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user