@@ -30,19 +30,6 @@ export enum CoreUserProfileHandlerType {
3030 BUTTON = 'button' , // User profile handler type to be shown as a button.
3131}
3232
33- declare module '@singletons/events' {
34-
35- /**
36- * Augment CoreEventsData interface with events specific to this service.
37- *
38- * @see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation
39- */
40- export interface CoreEventsData {
41- [ USER_DELEGATE_UPDATE_HANDLER_EVENT ] : CoreUserUpdateHandlerData ;
42- }
43-
44- }
45-
4633/**
4734 * Interface that all user profile handlers must implement.
4835 */
@@ -188,11 +175,6 @@ export interface CoreUserProfileHandlerToDisplay {
188175 type : string ;
189176}
190177
191- /**
192- * Delegate update handler event.
193- */
194- export const USER_DELEGATE_UPDATE_HANDLER_EVENT = 'CoreUserDelegate_update_handler_event' ;
195-
196178/**
197179 * Service to interact with plugins to be shown in user profile. Provides functions to register a plugin
198180 * and notify an update in the data.
@@ -232,21 +214,6 @@ export class CoreUserDelegateService extends CoreDelegate<CoreUserProfileHandler
232214 constructor ( ) {
233215 super ( ) ;
234216
235- CoreEvents . on ( USER_DELEGATE_UPDATE_HANDLER_EVENT , ( data ) => {
236- const handlersData = this . getHandlersData ( data . userId , data . context , data . contextId ) ;
237-
238- // Search the handler.
239- const handler = handlersData . handlers . find ( ( userHandler ) => userHandler . name == data . handler ) ;
240-
241- if ( ! handler ) {
242- return ;
243- }
244-
245- // Update the data and notify.
246- Object . assign ( handler . data , data . data ) ;
247- handlersData . observable . next ( handlersData . handlers ) ;
248- } ) ;
249-
250217 CoreEvents . on ( CoreEvents . LOGOUT , ( ) => {
251218 this . clearHandlerCache ( ) ;
252219 } ) ;
@@ -537,14 +504,3 @@ export enum CoreUserDelegateContext {
537504 COURSE = 'course' ,
538505 USER_MENU = 'user_menu' ,
539506}
540-
541- /**
542- * Data passed to UPDATE_HANDLER_EVENT event.
543- */
544- export type CoreUserUpdateHandlerData = {
545- handler : string ; // Name of the handler.
546- userId : number ; // User affected.
547- context : CoreUserDelegateContext ; // Context affected.
548- contextId ?: number ; // ID related to the context.
549- data : Record < string , unknown > ; // Data to set to the handler.
550- } ;
0 commit comments