Skip to content

Commit 739a2b4

Browse files
authored
Merge pull request #1667 from mercihabam/fix-flag-cb
fix(frontend): redirect to next message or flagged list when unflagging current message of flagged list
2 parents 5282a4a + e7304cd commit 739a2b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/imap/site.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,15 @@ var imap_flag_message = function(state, supplied_uid, supplied_detail) {
225225
if (state === 'flagged') {
226226
$('#flag_msg').show();
227227
$('#unflag_msg').hide();
228+
if (getParam('list_parent') === 'flagged') {
229+
// try to navigate to the next message in the list, if none found go back to the list
230+
const nextLink = $('.nlink').attr('href');
231+
if (nextLink) {
232+
navigate(nextLink);
233+
} else {
234+
navigate(`?page=message_list&list_path=${getParam('list_parent')}&list_page=${getParam('list_page')}&sort=${getParam('sort')}`);
235+
}
236+
}
228237
}
229238
else {
230239
$('#flag_msg').hide();

0 commit comments

Comments
 (0)