Fix /peek command

This commit is contained in:
Cohee 2023-12-19 23:12:14 +02:00
parent 6859e4443e
commit 029cf598ce
1 changed files with 5 additions and 3 deletions

View File

@ -845,7 +845,7 @@ async function unhideMessageCallback(_, arg) {
/**
* Copium for running group actions when the member is offscreen.
* @param {number} chid - character ID
* @param {string} action - one of 'enable', 'disable', 'up', 'down', 'peek', 'remove'
* @param {string} action - one of 'enable', 'disable', 'up', 'down', 'view', 'remove'
* @returns {void}
*/
function performGroupMemberAction(chid, action) {
@ -868,7 +868,9 @@ function performGroupMemberAction(chid, action) {
if (wasOffscreen) {
$(pageSizeSelector).val(paginationValue).trigger('change');
$(paginationSelector).pagination('go', pageValue);
if ($(paginationSelector).length) {
$(paginationSelector).pagination('go', pageValue);
}
}
}
@ -958,7 +960,7 @@ async function peekCallback(_, arg) {
return '';
}
performGroupMemberAction(chid, 'peek');
performGroupMemberAction(chid, 'view');
return '';
}