Skip to content

Commit

Permalink
gauth login handled
Browse files Browse the repository at this point in the history
  • Loading branch information
vanshulagarwal committed Jul 26, 2024
1 parent c36147e commit b7070ba
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions client/src/Pages/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const Dashboard = () => {

useEffect(() => {
if (searchParams.get('email') && searchParams.get('username') && searchParams.get('token')) {
localStorage.setItem('codaeztoken', searchParams.get('token'))
// localStorage.setItem('codaeztoken', searchParams.get('token'))

setTimeout(() => {
setReload(prev => prev + 1);
}, 1000);
// setTimeout(() => {
// setReload(prev => prev + 1);
// }, 1000);

dispatch(setAuth({
email: searchParams.get('email'),
Expand All @@ -53,6 +53,10 @@ const Dashboard = () => {
}
}, []);

if (searchParams.get('token')) {
localStorage.setItem('codaeztoken', searchParams.get('token'))
}

const [activePlatform, setActivePlatform] = useState('cf');
const [lineGraphData, setLineGraphData] = useState(null);
const [pieChartData, setPieChartData] = useState({});
Expand Down Expand Up @@ -223,12 +227,12 @@ const Dashboard = () => {
</div>
<div className="graphs">
{lineGraphData && lineGraphData.length > 0 && <div className="lineGraph">
<ErrorBoundary>
<LineGraph data={lineGraphData} platform={activePlatform} />
</ErrorBoundary>
<ErrorBoundary>
<LineGraph data={lineGraphData} platform={activePlatform} />
</ErrorBoundary>
</div>}
{pieChartData && activePlatform === 'cf' && <div className="piechart">
<ErrorBoundary>
<ErrorBoundary>
<PieChart data={pieChartData} platform={activePlatform} />
</ErrorBoundary>
</div>}
Expand Down

0 comments on commit b7070ba

Please sign in to comment.