Skip to content

Commit

Permalink
feat: remember delete with files preference #291
Browse files Browse the repository at this point in the history
  • Loading branch information
WDaan committed Aug 29, 2021
1 parent e6c0863 commit 684bbec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/App.vue
Expand Up @@ -49,7 +49,6 @@ export default {
}())
})
this.$store.commit('SET_APP_VERSION', process.env['APPLICATION_VERSION'])
this.checkDeviceDarkTheme()
this.checkAuthenticated()
},
methods: {
Expand Down
16 changes: 7 additions & 9 deletions src/components/Modals/ConfirmDeleteModal.vue
Expand Up @@ -30,15 +30,15 @@
<v-divider />
<v-card-actions class="justify-end">
<v-checkbox
v-model="withFiles"
v-model="settings.deleteWithFiles"
class="ma-0 pa-0"
label="Also delete the files on the storage"
hide-details
/>
<v-spacer />
<v-btn
class="white--text elevation-0 px-4"
:class="withFiles ? 'error' : 'info'"
:class="settings.deleteWithFiles ? 'error' : 'info'"
@click="deleteTorrent()"
>
Delete
Expand All @@ -61,16 +61,14 @@ import qbit from '@/services/qbit'
export default {
name: 'ConfirmDeleteModal',
mixins: [Modal],
data() {
return {
withFiles: false
}
},
computed: {
...mapState(['selected_torrents']),
...mapGetters(['getTorrents']),
...mapGetters(['getTorrents', 'getWebuiSettings']),
torrents() {
return this.getTorrents().filter(t => this.selected_torrents.includes(t.hash))
},
settings() {
return this.getWebuiSettings()
}
},
beforeDestroy() {
Expand All @@ -81,7 +79,7 @@ export default {
this.dialog = false
},
deleteTorrent() {
qbit.deleteTorrents(this.selected_torrents, this.withFiles)
qbit.deleteTorrents(this.selected_torrents, this.settings.deleteWithFiles)
this.close()
}
}
Expand Down
1 change: 1 addition & 0 deletions src/store/index.js
Expand Up @@ -57,6 +57,7 @@ export default new Vuex.Store({
showCurrentSpeed: true,
showTrackerFilter: false,
showSpeedInTitle: false,
deleteWithFiles: false,
title: 'Default',
rightDrawer: false,
paginationSize: 15,
Expand Down

0 comments on commit 684bbec

Please sign in to comment.