Remove SyncPlayToasts abstraction
This commit is contained in:
parent
dc294a5a4b
commit
9913f95945
5 changed files with 15 additions and 60 deletions
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue