Remove SyncPlayToasts abstraction

This commit is contained in:
Bill Thornton 2021-05-26 14:28:54 -04:00
parent dc294a5a4b
commit 9913f95945
5 changed files with 15 additions and 60 deletions

View file

@ -1,34 +0,0 @@
/**
* 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 '../core';
/**
* 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;