Skip to content

Commit

Permalink
add clear search history and reset data in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadali-arjomand committed Sep 18, 2023
1 parent 824bd2e commit 30e930c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pages/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function clearHistory() {
<v-dialog v-model="clearConfirmDlg">
<v-card title="فری مووی">
<v-card-text>
آیا میخواهید سابقه خود را پاک کنید؟
آیا میخواهید تاریخچه را پاک کنید؟
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
Expand Down
71 changes: 69 additions & 2 deletions src/pages/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
<script setup>
import {VApp, VAppBar, VAppBarTitle, VAppBarNavIcon, VIcon, VListItemSubtitle, VList, VListItem, VSwitch, VDivider} from "vuetify/components";
import {
VApp,
VAppBar,
VAppBarTitle,
VAppBarNavIcon,
VIcon,
VListItemSubtitle,
VList,
VListItem,
VSwitch,
VDivider,
VDialog, VSnackbar
} from "vuetify/components";
import router from "@/router";
import {ref, watch} from "vue";
import {useTheme} from "vuetify";
import {tr} from "vuetify/locale";
const themeManager = useTheme()
const themesName = {
Expand All @@ -17,6 +30,10 @@ const saveHistory = ref(localStorage.settingsSaveHistory === undefined ? true :
const copyLink = ref(localStorage.settingsCopyLink === undefined ? false : eval(localStorage.settingsCopyLink))
const openWithVlc = ref(localStorage.settingsOpenWithVlc === undefined ? false : eval(localStorage.settingsOpenWithVlc))
const clearConfirmDlg = ref(false)
const clearConfirmSnk = ref(false)
const resetDataDlg = ref(false)
watch(autoEnter, () => {
localStorage.settingsAutoEnter = autoEnter.value;
})
Expand Down Expand Up @@ -45,13 +62,50 @@ watch(openWithVlc, () => {
localStorage.settingsOpenWithVlc = openWithVlc.value;
})
function clearSearchHistory() {
clearConfirmDlg.value = false
localStorage.removeItem("search")
clearConfirmSnk.value = true
}
function resetData() {
resetDataDlg.value = false
localStorage.clear()
window.location.assign("/")
}
function goToGithub() {
window.location.assign("https://github.com/mohammadali-arjomand")
}
</script>

<template>
<v-app>
<v-snackbar v-model="clearConfirmSnk" :timeout="1000" color="snack">تاریخچه جستجو با موفقیت پاک شد!</v-snackbar>
<v-dialog v-model="clearConfirmDlg">
<v-card title="فری مووی">
<v-card-text>
آیا میخواهید تاریخچه جستجو را پاک کنید؟
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn text="بله" color="red" @click="clearSearchHistory"></v-btn>
<v-btn text="خیر" @click="clearConfirmDlg = false"></v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="resetDataDlg">
<v-card title="فری مووی">
<v-card-text>
آیا میخواهید تمام اطلاعات خود در فری مووی را پاک کنید؟
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn text="بله" color="red" @click="resetData"></v-btn>
<v-btn text="خیر" @click="resetDataDlg = false"></v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-app-bar color="blue-darken-2">
<v-app-bar-nav-icon @click="router.back()"><v-icon>mdi-arrow-right</v-icon></v-app-bar-nav-icon>
<v-app-bar-title>تنظیمات</v-app-bar-title>
Expand Down Expand Up @@ -84,7 +138,7 @@ function goToGithub() {
اگر غیرفعال شود، تاریخچه مشاهده های شما ذخیره نخواهد شد.
</v-list-item-subtitle>
</v-list-item>
<v-divider class="mb-4"/>
<v-divider class="mb-4" />
<v-list-item class="py-0">
<span>
کپی لینک
Expand All @@ -104,6 +158,19 @@ function goToGithub() {
</v-list-item-subtitle>
</v-list-item>
<v-divider/>
<v-list-item class="py-0" @click="clearConfirmDlg = true">
<span>پاکسازی تاریخچه جستجو</span>
<v-list-item-subtitle>
تاریخچه جسجتوهای شما به طور کامل پاک می شوند و دیگر در دسترس نیستند.
</v-list-item-subtitle>
</v-list-item>
<v-list-item class="py-0" @click="resetDataDlg = true">
<span>بازنشانی اطلاعات</span>
<v-list-item-subtitle>
تمام اطلاعات شما در برنامه از جمله تنظیمات، تاریخچه، نشان ها و... از بین می روند.
</v-list-item-subtitle>
</v-list-item>
<v-divider/>
<p class="ltr text-center py-4">
<v-icon>mdi-xml</v-icon>
with
Expand Down

0 comments on commit 30e930c

Please sign in to comment.