-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
myCourses.ts broadcasts a filter change to all other tabs, but it doesnt broadcast to itself, leading to the dropdown becoming out of date.
I already have a fix for this, in myCourses.ts:
// send an update message if on the myCourses page
if (window.location.pathname === '/my/courses.php') {
void requirePromise([
'jquery',
'block_myoverview/selectors',
'core/custom_interaction_events',
] as const).then(([jquery, selectors, events]) =>
// as long as moodle uses jQuery there seems to be no way to do it whithout jQuery
jquery('.block-myoverview')
?.find(selectors.FILTERS)
?.on(
// ...
// Trigger local hooks first
activeFilterChangedHooks.forEach(hook => hook(filter));
// Then broadcast to other tabs
const channel = new BroadcastChannel(
updateActiveFilterChannelName
);
channel.postMessage(filter);
channel.close();
}
)
);
}This seems to work and I'll include it in my pr for course caching.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels