deselect a channel on "all <channel-group>"
This commit is contained in:
@@ -150,11 +150,22 @@ App.videos = App.videos || {};
|
||||
const searchInput = document.getElementById('search-input');
|
||||
const query = searchInput ? searchInput.value : "";
|
||||
|
||||
if (!state.groupCursors || state.groupCursors.groupId !== group.id || state.groupCursors.query !== query) {
|
||||
// Honor the per-group "Channels" multi-select filter so disabled
|
||||
// channels are skipped. Falls back to the full group when nothing is
|
||||
// selected (e.g. older sessions without the filter).
|
||||
const selectedChannels = session.options ? session.options[App.session.GROUP_CHANNELS_OPTION_ID] : null;
|
||||
const enabledIds = (Array.isArray(selectedChannels) && selectedChannels.length > 0 ?
|
||||
selectedChannels.map((opt) => opt.id) :
|
||||
group.channelIds).filter((id) => group.channelIds.includes(id));
|
||||
const signature = enabledIds.join(',');
|
||||
|
||||
if (!state.groupCursors || state.groupCursors.groupId !== group.id ||
|
||||
state.groupCursors.query !== query || state.groupCursors.signature !== signature) {
|
||||
state.groupCursors = {
|
||||
groupId: group.id,
|
||||
query: query,
|
||||
channels: group.channelIds.map((id) => ({ id, page: 1, hasNextPage: true }))
|
||||
signature: signature,
|
||||
channels: enabledIds.map((id) => ({ id, page: 1, hasNextPage: true }))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user