mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	show confirmation modal before deleting subscription group
This commit is contained in:
		
							parent
							
								
									0552875cab
								
							
						
					
					
						commit
						3275db0a37
					
				
					 2 changed files with 14 additions and 4 deletions
				
			
		| 
						 | 
					@ -53,9 +53,16 @@
 | 
				
			||||||
            <span v-text="group.groupName !== '' ? group.groupName : $t('video.all')" />
 | 
					            <span v-text="group.groupName !== '' ? group.groupName : $t('video.all')" />
 | 
				
			||||||
            <div v-if="group.groupName != '' && selectedGroup == group">
 | 
					            <div v-if="group.groupName != '' && selectedGroup == group">
 | 
				
			||||||
                <i class="i-fa6-solid:pen mx-2" @click="showEditGroupModal = true" />
 | 
					                <i class="i-fa6-solid:pen mx-2" @click="showEditGroupModal = true" />
 | 
				
			||||||
                <i class="i-fa6-solid:circle-minus mx-2" @click="deleteGroup(group)" />
 | 
					                <i class="i-fa6-solid:circle-minus mx-2" @click="groupToDelete = group.groupName" />
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					            <ConfirmModal
 | 
				
			||||||
 | 
					                v-if="groupToDelete == group.groupName"
 | 
				
			||||||
 | 
					                :message="$t('actions.delete_group_confirm')"
 | 
				
			||||||
 | 
					                @close="groupToDelete = null"
 | 
				
			||||||
 | 
					                @confirm="deleteGroup(group)"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <button class="btn mx-1" @click="showCreateGroupModal = true">
 | 
					        <button class="btn mx-1" @click="showCreateGroupModal = true">
 | 
				
			||||||
            <i class="i-fa6-solid:circle-plus" />
 | 
					            <i class="i-fa6-solid:circle-plus" />
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
| 
						 | 
					@ -118,9 +125,10 @@
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import ModalComponent from "./ModalComponent.vue";
 | 
					import ModalComponent from "./ModalComponent.vue";
 | 
				
			||||||
import CreateGroupModal from "./CreateGroupModal.vue";
 | 
					import CreateGroupModal from "./CreateGroupModal.vue";
 | 
				
			||||||
 | 
					import ConfirmModal from "./ConfirmModal.vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    components: { ModalComponent, CreateGroupModal },
 | 
					    components: { ModalComponent, CreateGroupModal, ConfirmModal },
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            subscriptions: [],
 | 
					            subscriptions: [],
 | 
				
			||||||
| 
						 | 
					@ -132,6 +140,7 @@ export default {
 | 
				
			||||||
            showCreateGroupModal: false,
 | 
					            showCreateGroupModal: false,
 | 
				
			||||||
            showEditGroupModal: false,
 | 
					            showEditGroupModal: false,
 | 
				
			||||||
            editedGroupName: "",
 | 
					            editedGroupName: "",
 | 
				
			||||||
 | 
					            groupToDelete: null,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    computed: {
 | 
					    computed: {
 | 
				
			||||||
| 
						 | 
					@ -153,7 +162,6 @@ export default {
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.channelGroups.push(this.selectedGroup);
 | 
					        this.channelGroups.push(this.selectedGroup);
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (!window.db) return;
 | 
					        if (!window.db) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.loadChannelGroups();
 | 
					        this.loadChannelGroups();
 | 
				
			||||||
| 
						 | 
					@ -235,6 +243,7 @@ export default {
 | 
				
			||||||
            this.deleteChannelGroup(group.groupName);
 | 
					            this.deleteChannelGroup(group.groupName);
 | 
				
			||||||
            this.channelGroups = this.channelGroups.filter(g => g != group);
 | 
					            this.channelGroups = this.channelGroups.filter(g => g != group);
 | 
				
			||||||
            this.selectedGroup = this.channelGroups[0];
 | 
					            this.selectedGroup = this.channelGroups[0];
 | 
				
			||||||
 | 
					            this.groupToDelete = null;
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        checkedChange(subscription) {
 | 
					        checkedChange(subscription) {
 | 
				
			||||||
            const channelId = subscription.url.substr(-24);
 | 
					            const channelId = subscription.url.substr(-24);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -101,6 +101,7 @@
 | 
				
			||||||
        "delete_playlist": "Delete Playlist",
 | 
					        "delete_playlist": "Delete Playlist",
 | 
				
			||||||
        "select_playlist": "Select a Playlist",
 | 
					        "select_playlist": "Select a Playlist",
 | 
				
			||||||
        "delete_playlist_confirm": "Delete this playlist?",
 | 
					        "delete_playlist_confirm": "Delete this playlist?",
 | 
				
			||||||
 | 
					        "delete_group_confirm": "Delete this group?",
 | 
				
			||||||
        "please_select_playlist": "Please select a playlist",
 | 
					        "please_select_playlist": "Please select a playlist",
 | 
				
			||||||
        "delete_account": "Delete Account",
 | 
					        "delete_account": "Delete Account",
 | 
				
			||||||
        "logout": "Logout from this device",
 | 
					        "logout": "Logout from this device",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue