Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show confirmation modal before deleting subscription group #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/components/SubscriptionsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@
<span v-text="group.groupName !== '' ? group.groupName : $t('video.all')" />
<div v-if="group.groupName != '' && selectedGroup == group">
<i class="i-fa6-solid:edit 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>
<ConfirmModal
v-if="groupToDelete == group.groupName"
:message="$t('actions.delete_group_confirm')"
@close="groupToDelete = null"
@confirm="deleteGroup(group)"
/>
</button>
<button class="btn mx-1" @click="showCreateGroupModal = true">
<i class="i-fa6-solid:circle-plus" />
Expand Down Expand Up @@ -118,9 +124,10 @@
<script>
import ModalComponent from "./ModalComponent.vue";
import CreateGroupModal from "./CreateGroupModal.vue";
import ConfirmModal from "./ConfirmModal.vue";

export default {
components: { ModalComponent, CreateGroupModal },
components: { ModalComponent, CreateGroupModal, ConfirmModal },
data() {
return {
subscriptions: [],
Expand All @@ -132,6 +139,7 @@ export default {
showCreateGroupModal: false,
showEditGroupModal: false,
editedGroupName: "",
groupToDelete: null,
};
},
computed: {
Expand Down Expand Up @@ -235,6 +243,7 @@ export default {
this.deleteChannelGroup(group.groupName);
this.channelGroups = this.channelGroups.filter(g => g != group);
this.selectedGroup = this.channelGroups[0];
this.groupToDelete = null;
},
checkedChange(subscription) {
const channelId = subscription.url.substr(-24);
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"delete_playlist_confirm": "Delete this playlist?",
"please_select_playlist": "Please select a playlist",
"delete_account": "Delete Account",
"delete_group_confirm": "Delete this group?",
"logout": "Logout from this device",
"minimize_recommendations_default": "Minimize Recommendations by default",
"minimize_chapters_default": "Minimize Chapters by default",
Expand Down Expand Up @@ -226,4 +227,4 @@
"register_note": "Register an account for this Piped instance. This will allow you to sync your subscriptions and playlists with your account, so they're stored on the server side. You can use all features without an account, but all data will be stored in your browser's local cache. Please make sure you do NOT use an email address as your username and choose a secure password that you do not use elsewhere.",
"login_note": "Log in with an account created on this instance."
}
}
}
Loading