Show Pair Programming modal for new Programming Groups

This commit is contained in:
Sebastian Serth
2023-09-13 04:33:31 +02:00
parent 2c46ad2c25
commit bea2e02fa5

View File

@ -18,7 +18,11 @@ $(document).on('turbolinks:load', function () {
if (modal.isPresent()) {
ProgrammingGroups.initializeEventHandler();
if (ProgrammingGroups.getStoredViewedPPInfo() !== 'true' && !_.isEqual(current_user, current_contributor)) {
// We only show the modal if the user has not decided to hide it on the current device.
// Further, the modal is either shown on /implement for a programming group or on /programming_groups/new.
if (ProgrammingGroups.getStoredViewedPPInfo() !== 'true' &&
((window.location.pathname.includes('/implement') && !_.isEqual(current_user, current_contributor)) ||
window.location.pathname.includes('/programming_groups/new'))) {
new bootstrap.Modal(modal).show();
}
}