mirror of
https://github.com/TeamPiped/Piped.git
synced 2026-09-15 17:23:45 +00:00
implement fixes for review
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
<div class="flex min-w-[50vw] flex-col">
|
||||
<div class="h-[70vh] overflow-y-scroll pr-4">
|
||||
<span v-t="'actions.add_to_group'" class="mb-3 inline-block w-max text-2xl" />
|
||||
<div v-for="(group, index) in channelGroups" :key="group.groupName" class="px-1">
|
||||
<div v-for="group in channelGroups" :key="group.groupName" class="px-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<span>{{ group.groupName }}</span>
|
||||
<UiCheckbox
|
||||
:model-value="group.channels.includes(channelId)"
|
||||
@update:model-value="onCheckedChange(index, group)"
|
||||
@update:model-value="onCheckedChange(group)"
|
||||
/>
|
||||
</div>
|
||||
<hr class="h-1 w-full" />
|
||||
@@ -56,9 +56,12 @@ onMounted(() => {
|
||||
loadChannelGroups();
|
||||
});
|
||||
|
||||
function onCheckedChange(index, group) {
|
||||
function onCheckedChange(group) {
|
||||
if (group.channels.includes(props.channelId)) {
|
||||
group.channels.splice(index, 1);
|
||||
const channelIndex = group.channels.indexOf(props.channelId);
|
||||
if (channelIndex !== -1) {
|
||||
group.channels.splice(channelIndex, 1);
|
||||
}
|
||||
} else {
|
||||
group.channels.push(props.channelId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user