mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 14:52:13 +00:00
close loader modal when receive UserAuthenticated event
This commit is contained in:
parent
226f1c7eb4
commit
8825e4389f
1 changed files with 2 additions and 1 deletions
|
|
@ -77,12 +77,14 @@ const Intro = ({ queryParams }) => {
|
|||
useCoreEvent(React.useCallback(({ event, args }) => {
|
||||
switch (event) {
|
||||
case 'UserAuthenticated': {
|
||||
closeLoaderModal();
|
||||
window.location.replace('#/');
|
||||
break;
|
||||
}
|
||||
case 'Error': {
|
||||
if (args.source.event === 'UserAuthenticated') {
|
||||
// TODO use error.code to match translated message;
|
||||
closeLoaderModal();
|
||||
dispatch({ type: 'error', error: args.error.message });
|
||||
}
|
||||
break;
|
||||
|
|
@ -133,7 +135,6 @@ const Intro = ({ queryParams }) => {
|
|||
dispatch({ type: 'error', error: 'Invalid password' });
|
||||
return;
|
||||
}
|
||||
dispatch({ type: 'error', error: '' });
|
||||
openLoaderModal();
|
||||
core.dispatch({
|
||||
action: 'Ctx',
|
||||
|
|
|
|||
Loading…
Reference in a new issue