mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: session issues/bugs
This commit is contained in:
parent
81bc8e7e82
commit
644693149a
20 changed files with 20 additions and 21 deletions
|
|
@ -15,7 +15,7 @@ import { updateUserAvatar } from '@services/users/users'
|
|||
|
||||
function UserEditGeneral() {
|
||||
const session = useLHSession() as any;
|
||||
const access_token = session.data.tokens.access_token;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
const [localAvatar, setLocalAvatar] = React.useState(null) as any
|
||||
const [isLoading, setIsLoading] = React.useState(false) as any
|
||||
const [error, setError] = React.useState() as any
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import React, { useEffect } from 'react'
|
|||
|
||||
function UserEditPassword() {
|
||||
const session = useLHSession() as any
|
||||
const access_token = session.data.tokens.access_token;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
|
||||
const updatePasswordUI = async (values: any) => {
|
||||
let user_id = session.data.user.id
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { useLHSession } from '@components/Contexts/LHSessionContext'
|
|||
function OrgAccess() {
|
||||
const org = useOrg() as any
|
||||
const session = useLHSession() as any
|
||||
const access_token = session.data.tokens.access_token;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
const { data: invites } = useSWR(
|
||||
org ? `${getAPIUrl()}orgs/${org?.id}/invites` : null,
|
||||
(url) => swrFetcher(url, access_token)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import useSWR, { mutate } from 'swr'
|
|||
function OrgUserGroups() {
|
||||
const org = useOrg() as any
|
||||
const session = useLHSession() as any
|
||||
const access_token = session.data.tokens.access_token;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
const [userGroupManagementModal, setUserGroupManagementModal] = React.useState(false)
|
||||
const [createUserGroupModal, setCreateUserGroupModal] = React.useState(false)
|
||||
const [selectedUserGroup, setSelectedUserGroup] = React.useState(null) as any
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import useSWR, { mutate } from 'swr'
|
|||
function OrgUsers() {
|
||||
const org = useOrg() as any
|
||||
const session = useLHSession() as any
|
||||
const access_token = session.data.tokens.access_token;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
const { data: orgUsers } = useSWR(
|
||||
org ? `${getAPIUrl()}orgs/${org?.id}/users` : null,
|
||||
(url) => swrFetcher(url, access_token)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import useSWR, { mutate } from 'swr'
|
|||
function OrgUsersAdd() {
|
||||
const org = useOrg() as any
|
||||
const session = useLHSession() as any
|
||||
const access_token = session.data.tokens.access_token;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
const [isLoading, setIsLoading] = React.useState(false)
|
||||
const [invitedUsers, setInvitedUsers] = React.useState('');
|
||||
const [selectedInviteCode, setSelectedInviteCode] = React.useState('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue