mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 03:22:11 +00:00
alert error if stremio-core failed to initialize
This commit is contained in:
parent
073be58307
commit
09be8bce0d
1 changed files with 5 additions and 1 deletions
|
|
@ -24,7 +24,11 @@ const App = () => {
|
||||||
const [shellInitialized, setShellInitialized] = React.useState(false);
|
const [shellInitialized, setShellInitialized] = React.useState(false);
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const onCoreStateChanged = () => {
|
const onCoreStateChanged = () => {
|
||||||
setCoreInitialized(services.core.active);
|
if (services.core.error) {
|
||||||
|
alert(services.core.error);
|
||||||
|
} else if (services.core.active) {
|
||||||
|
setCoreInitialized(services.core.active);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const onShellStateChanged = () => {
|
const onShellStateChanged = () => {
|
||||||
setShellInitialized(services.shell.active || services.shell.error instanceof Error);
|
setShellInitialized(services.shell.active || services.shell.error instanceof Error);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue