Skip to content

Commit

Permalink
fix: 先下掉客户端本地存储功能,已修复部分异常问题 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ximu-Luya authored Mar 17, 2024
2 parents 8e0177c + 13345b2 commit 579f98e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ export type ListSortMode = 'byCity' | 'byProfit' | 'byPerTicketProfit'
export type ProfitComputeRule = 'maxPriceChange' | 'noChange'

export const useSettingStore = defineStore('setting', () => {
const listSortMode = useStorage<ListSortMode>('listSortMode', 'byCity')
const profitComputeRule = useStorage<ProfitComputeRule>('profitComputeRule', 'noChange')
// const listSortMode = useStorage<ListSortMode>('listSortMode', 'byCity')
// const profitComputeRule = useStorage<ProfitComputeRule>('profitComputeRule', 'noChange')

const listSortMode = ref<ListSortMode>('byCity')
const profitComputeRule = ref<ProfitComputeRule>('noChange')

// 切换列表排序模式
const switchListSortModeTo = (targetMode: ListSortMode) => {
Expand All @@ -19,9 +22,11 @@ export const useSettingStore = defineStore('setting', () => {
}

return {
listSortMode: skipHydrate(listSortMode),
listSortMode: listSortMode,
// listSortMode: skipHydrate(listSortMode),
switchListSortModeTo,
profitComputeRule: skipHydrate(profitComputeRule),
profitComputeRule: listSortMode,
// profitComputeRule: skipHydrate(profitComputeRule),
switchProfitComputeRuleTo
}
})

0 comments on commit 579f98e

Please sign in to comment.