Skip to content

Commit

Permalink
perf: ♻️ Configure Incompatible Handling Mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 9, 2023
1 parent 517091a commit c0e6a01
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/components/Device/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default {
handleRefresh() {
this.getDeviceData({ resetResolve: true })
},
async handleReset(depType = 'scrcpy') {
async handleReset() {
try {
await this.$confirm(
`
Expand All @@ -226,7 +226,7 @@ export default {
},
)
this.$store.preference.resetDeps(depType)
this.$store.preference.reset()
this.$root.reRender('Preference')
Expand Down Expand Up @@ -293,6 +293,7 @@ export default {
if (error.message) {
this.$message.warning(error.message)
}
this.handleReset()
}
row.$recordLoading = false
},
Expand Down Expand Up @@ -390,7 +391,7 @@ export default {
this.deviceList = []
if (resetResolve) {
this.handleReset('adb')
this.handleReset()
}
}
this.loading = false
Expand Down
6 changes: 3 additions & 3 deletions src/locales/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
"device.wireless.pair.code.placeholder": "Input pair code",

"device.reset.title": "Operation Failed",
"device.reset.reasons[0]": "This is usually caused by incompatible cached dependencies after updating Escrcpy. Reset dependencies?",
"device.reset.reasons[1]": "Note: Dependencies will be cleared after reset, please backup first.",
"device.reset.confirm": "Reset Dependencies",
"device.reset.reasons[0]": "Typically, this may be caused by incompatible configurations. Do you want to reset preferences?",
"device.reset.reasons[1]": "Note: After resetting, any previously saved configurations will be cleared, so it is recommended to back up your configurations before performing the reset operation.",
"device.reset.confirm": "Reset Preferences",
"device.reset.cancel": "@:common.cancel",
"device.reset.success": "Success, please try again",

Expand Down
6 changes: 3 additions & 3 deletions src/locales/languages/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
"device.wireless.pair.code.placeholder": "请输入配对码",

"device.reset.title": "操作失败",
"device.reset.reasons[0]": "通常情况下,这可能是因为更新 Escrcpy 后,缓存的依赖配置不兼容所导致的,是否重置依赖配置",
"device.reset.reasons[1]": "注意:重置后,之前保存的依赖配置将会被清除,因此建议在执行重置操作之前备份您的配置。",
"device.reset.confirm": "重置依赖配置",
"device.reset.reasons[0]": "通常情况下,这可能是配置不兼容所导致的,是否重置偏好设置",
"device.reset.reasons[1]": "注意:重置后,之前保存的配置将会被清除,因此建议在执行重置操作之前备份您的配置。",
"device.reset.confirm": "重置偏好设置",
"device.reset.cancel": "@:common.cancel",
"device.reset.success": "操作成功,请重新尝试。",
"device.refresh.name": "刷新设备",
Expand Down
2 changes: 1 addition & 1 deletion src/store/preference/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const usePreferenceStore = defineStore({
},
reset(scope) {
if (!scope) {
window.appStore.reset()
window.appStore.clear()
}
else {
const fields = getTopFields()
Expand Down

0 comments on commit c0e6a01

Please sign in to comment.