mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 02:22:09 +00:00
show toast when torrent/magnet is parsed in core
This commit is contained in:
parent
5516a760d2
commit
74679689cf
1 changed files with 26 additions and 7 deletions
|
|
@ -9,13 +9,32 @@ const ServicesToaster = () => {
|
|||
const toast = useToast();
|
||||
React.useEffect(() => {
|
||||
const onCoreEvent = ({ event, args }) => {
|
||||
if (event === 'Error') {
|
||||
toast.show({
|
||||
type: 'error',
|
||||
title: args.source.event,
|
||||
message: args.error.message,
|
||||
timeout: 4000
|
||||
});
|
||||
switch (event) {
|
||||
case 'Error': {
|
||||
toast.show({
|
||||
type: 'error',
|
||||
title: args.source.event,
|
||||
message: args.error.message,
|
||||
timeout: 4000
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'TorrentParsed': {
|
||||
toast.show({
|
||||
type: 'success',
|
||||
title: 'Torrent file parsed',
|
||||
timeout: 4000
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'MagnetParsed': {
|
||||
toast.show({
|
||||
type: 'success',
|
||||
title: 'Magnet link parsed',
|
||||
timeout: 4000
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
const onDrop = (file) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue