u
This commit is contained in:
1 parent
bce259f165
commit
dc46d8034d
8 files changed
+430
-259
No files matched your search
@@ -14,7 +14,7 @@ interface MoneyRecordStore {
|
||||
getTotalExpense: () => string
|
||||
getTotalBalance: () => string
|
||||
|
||||
setRecords: (records: MoneyRecord[], month: string) => void
|
||||
setRecords: (records: MoneyRecord[]) => void
|
||||
setCurrentMonth: (month: string) => void
|
||||
|
||||
getMoneyRecordById: (id: number) => MoneyRecord | null
|
||||
@@ -71,12 +71,9 @@ export const useMoneyRecordStore = create<MoneyRecordStore>((set, get) => ({
|
||||
},
|
||||
|
||||
/* ---------------- base ---------------- */
|
||||
setRecords: (records, month) => {
|
||||
const filtered = records.filter(r =>
|
||||
isInMonth(r.record_time, month),
|
||||
)
|
||||
const newGroups = recomputeGroups(filtered)
|
||||
set({ records: newGroups, currentMonth: month })
|
||||
setRecords: (records) => {
|
||||
const newGroups = recomputeGroups(records)
|
||||
set({ records: newGroups })
|
||||
},
|
||||
|
||||
setCurrentMonth: month => set({ currentMonth: month }),
|
||||
|
||||
Reference in new issue
Block a user