Skip to content

Commit 269bd29

Browse files
committed
fix: 🐛 Fixed an issue where some options in preferences could not be turned off
1 parent dd3ad6c commit 269bd29

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/components/PreferenceForm/index.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@
8585
</template>
8686

8787
<script setup>
88-
import { i18n } from '$/locales/index.js'
89-
9088
import { usePreferenceStore } from '$/store/index.js'
9189
9290
import { omit } from 'lodash-es'
@@ -108,8 +106,6 @@ const props = defineProps({
108106
},
109107
})
110108
111-
const locale = computed(() => i18n.global.locale.value)
112-
113109
const preferenceData = defineModel('modelValue', {
114110
type: Object,
115111
default: () => ({}),

src/store/preference/helpers/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ export function mergeConfig(object, sources) {
103103
const customizer = (objValue, srcValue, key) => {
104104
let value
105105

106-
if (srcValue) {
106+
if (![void 0].includes(srcValue)) {
107107
value = srcValue
108108
}
109-
else if (objValue) {
109+
else {
110110
value = objValue
111111
}
112112

src/store/preference/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const usePreferenceStore = defineStore({
6060
setData(data, scope = this.deviceScope) {
6161
const pickData = pickBy(
6262
data,
63-
value => !!value || typeof value === 'number',
63+
value => !['', void 0].includes(value),
6464
)
6565

6666
if (data.adbPath === adbPath) {

0 commit comments

Comments
 (0)