1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add playlist-sync and group-wait to SyncPlay

This commit is contained in:
Ionut Andrei Oanca 2020-09-25 09:44:30 +02:00
parent 46a0382c0a
commit d8beb9909f
41 changed files with 3880 additions and 1125 deletions

View file

@ -0,0 +1,34 @@
/**
* Module that notifies user about SyncPlay messages using toasts.
* @module components/syncPlay/syncPlayToasts
*/
import { Events } from 'jellyfin-apiclient';
import toast from '../../toast/toast';
import globalize from '../../../scripts/globalize';
import SyncPlay from 'SyncPlay';
/**
* Class that notifies user about SyncPlay messages using toasts.
*/
class SyncPlayToasts {
constructor() {
// Do nothing.
}
/**
* Listens for messages to show.
*/
init() {
Events.on(SyncPlay.Manager, 'show-message', (event, data) => {
const { message, args = [] } = data;
toast({
text: globalize.translate(message, ...args)
});
});
}
}
/** SyncPlayToasts singleton. */
const syncPlayToasts = new SyncPlayToasts();
export default syncPlayToasts;