Skip to content

Commit bf48647

Browse files
committed
Update TaskPage and states.ts files
1 parent 4e2c06b commit bf48647

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/TaskPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function TaskPage() {
6363

6464
return (
6565
<div className="">
66-
<Tabs variant='soft-rounded' colorScheme='green' h='80%'>
66+
<Tabs variant='soft-rounded' colorScheme='green' h='80%' index={activeTaskCategory} defaultIndex={activeTaskCategory}>
6767
<TaskCategoryList />
6868
{
6969
loading || taskCategoryList.length <= 0 ? (

src/config/states.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Task } from '../helpers/task';
44
import { task, taskCategory } from '../types/taskapi';
55
import { SettingsStore } from '../helpers/DBStores';
66
import settings from './settings';
7+
import { get_access_token } from '../helpers/invoker';
78

89

910
// const loggedInState = atom({
@@ -28,7 +29,7 @@ const userProfileState = atom<UserProfile | null>({
2829

2930
const accessTokenState = atom<string | null>({
3031
key: 'accessTokenState',
31-
default: null,
32+
default: (await get_access_token()).access_token,
3233
});
3334

3435
const taskObjectState = atom<Task>({
@@ -85,7 +86,8 @@ const loggedInSelector = selector({
8586
key: 'loggedInSelector',
8687
get: ({ get }) => {
8788
const loggedIn = get(userProfileState);
88-
return loggedIn && loggedIn.email != null && loggedIn.email != "";
89+
const accessToken = get(accessTokenState);
90+
return loggedIn && loggedIn.email != null && loggedIn.email != "" && accessToken;
8991
},
9092
});
9193

0 commit comments

Comments
 (0)