Skip to content

Commit 94b2158

Browse files
committed
MOBILE-3523 core: Fix handlers order if one hasn't priority
1 parent 8d95636 commit 94b2158

File tree

12 files changed

+12
-11
lines changed

12 files changed

+12
-11
lines changed

src/core/contentlinks/providers/delegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class CoreContentLinksDelegate {
191191

192192
// Add them to the list.
193193
linkActions.push({
194-
priority: handler.priority,
194+
priority: handler.priority || 0,
195195
actions: actions
196196
});
197197
}

src/core/course/providers/options-delegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export class CoreCourseOptionsDelegate extends CoreDelegate {
405405
promises.push(Promise.resolve(getFunction.call(handler, injector, course)).then((data) => {
406406
handlersToDisplay.push({
407407
data: data,
408-
priority: handler.priority,
408+
priority: handler.priority || 0,
409409
prefetch: handler.prefetch && handler.prefetch.bind(handler),
410410
name: handler.name
411411
});

src/core/fileuploader/providers/delegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class CoreFileUploaderDelegate extends CoreDelegate {
177177
}
178178

179179
const data: CoreFileUploaderHandlerDataToReturn = handler.getData();
180-
data.priority = handler.priority;
180+
data.priority = handler.priority || 0;
181181
data.mimetypes = supportedMimetypes;
182182
handlers.push(data);
183183
}

src/core/mainmenu/providers/delegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class CoreMainMenuDelegate extends CoreDelegate {
162162
handlersData.push({
163163
name: name,
164164
data: data,
165-
priority: handler.priority
165+
priority: handler.priority || 0,
166166
});
167167
}
168168

src/core/pushnotifications/providers/delegate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export class CorePushNotificationsDelegate {
177177

178178
this.logger.log(`Registered addon '${handler.name}'`);
179179
this.clickHandlers[handler.name] = handler;
180+
handler.priority = handler.priority || 0;
180181

181182
return true;
182183
}

src/core/settings/providers/delegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class CoreSettingsDelegate extends CoreDelegate {
108108

109109
handlersData.push({
110110
data: data,
111-
priority: handler.priority
111+
priority: handler.priority || 0,
112112
});
113113
}
114114

src/core/siteplugins/classes/handlers/course-option-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class CoreSitePluginsCourseOptionHandler extends CoreSitePluginsBaseHandl
3535
protected utils: CoreUtilsProvider) {
3636
super(name);
3737

38-
this.priority = handlerSchema.priority;
38+
this.priority = handlerSchema.priority || 0;
3939
this.isMenuHandler = !!handlerSchema.ismenuhandler;
4040
}
4141

src/core/siteplugins/classes/handlers/main-menu-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class CoreSitePluginsMainMenuHandler extends CoreSitePluginsBaseHandler i
2525
protected initResult: any) {
2626
super(name);
2727

28-
this.priority = handlerSchema.priority;
28+
this.priority = handlerSchema.priority || 0;
2929
}
3030

3131
/**

src/core/siteplugins/classes/handlers/message-output-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class CoreSitePluginsMessageOutputHandler extends CoreSitePluginsBaseHand
3232
*/
3333
getDisplayData(): AddonMessageOutputHandlerData {
3434
return {
35-
priority: this.handlerSchema.priority,
35+
priority: this.handlerSchema.priority || 0,
3636
label: this.title,
3737
icon: this.handlerSchema.displaydata.icon,
3838
page: 'CoreSitePluginsPluginPage',

src/core/siteplugins/classes/handlers/settings-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class CoreSitePluginsSettingsHandler extends CoreSitePluginsBaseHandler i
2525
protected initResult: any) {
2626
super(name);
2727

28-
this.priority = handlerSchema.priority;
28+
this.priority = handlerSchema.priority || 0;
2929
}
3030

3131
/**

0 commit comments

Comments
 (0)