Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodlenet
MoodleNet Frontend
Commits
fadd5811
Commit
fadd5811
authored
Jun 01, 2020
by
aleclofabbro
Browse files
hotfixed bug introduced on last commit
parent
c2a6c3a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fe/session/useMe.ts
View file @
fadd5811
import
{
mnCtx
}
from
'
fe/lib/graphql/ctx
'
;
import
{
useCallback
,
useMemo
}
from
'
react
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
*
as
GQL
from
'
./me.generated
'
;
import
{
useCallOrNotifyMustLogin
}
from
'
HOC/lib/notifyMustLogin
'
;
import
{
getMaybeUploadInput
}
from
'
fe/mutation/upload/getUploadInput
'
;
import
Maybe
from
'
graphql/tsutils/Maybe
'
;
import
{
UpdateProfileInput
}
from
'
graphql/types.generated
'
;
import
{
LMSPrefs
}
from
'
fe/lib/moodleLMS/LMSintegration
'
;
import
{
withEncodedExtraInfo
,
WithExtraInfo
}
from
'
fe/lib/extraInfo/extraInfo
'
;
import
{
mnCtx
}
from
'
fe/lib/graphql/ctx
'
;
import
{
LMSPrefs
}
from
'
fe/lib/moodleLMS/LMSintegration
'
;
import
{
getMaybeUploadInput
}
from
'
fe/mutation/upload/getUploadInput
'
;
import
Maybe
from
'
graphql/tsutils/Maybe
'
;
import
{
UpdateProfileInput
}
from
'
graphql/types.generated
'
;
import
{
useCallback
,
useMemo
}
from
'
react
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
*
as
GQL
from
'
./me.generated
'
;
type
UserProfileExtraInfo
=
{
LMS
?:
LMSPrefs
;
...
...
@@ -55,7 +54,7 @@ export const useMe = () => {
}).
finally
(()
=>
push
(
'
/login
'
));
},
[
me
,
logoutStatus
.
loading
]);
const
updateProfile
=
useCall
OrNotifyMustLogin
(
const
updateProfile
=
useCall
back
(
async
({
icon
,
image
,
profile
}:
UpdateProfile
)
=>
{
if
(
updateProfileMutationStatus
.
loading
||
!
me
?.
user
)
{
return
;
...
...
@@ -71,7 +70,13 @@ export const useMe = () => {
},
[
updateProfileMutation
,
me
,
updateProfileMutationStatus
]
);
console
.
table
({
me
,
isAdmin
,
logout
,
loading
,
updateProfile
});
return
useMemo
(()
=>
{
return
{
me
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment