Skip to content

Commit

Permalink
fix: Ignore download count in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
otomir23 committed Jun 15, 2024
1 parent d3984a6 commit 5f7834b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export const getSettingsMenu = (settings: Settings) => {

const getSettings = async (id?: number | null) => {
if (id === null || id === undefined) return defaultSettings
const { id: _, ...settings } = await db.query.users.findFirst({
const { id: _, downloadCount: __, ...settings } = await db.query.users.findFirst({
where: eq(users.id, id),
}) || { id, ...defaultSettings }
}) || { id, downloadCount: 0, ...defaultSettings }
return settings
}

Expand All @@ -78,7 +78,7 @@ export const updateSetting = async (key: string, current: Settings, user: number
.onConflictDoUpdate({ target: users.id, set: { [validKey]: newOption } })
.returning()

const { id: _, ...newSettings } = newData[0]
const { id: _, downloadCount: __, ...newSettings } = newData[0]
return newSettings
}

Expand Down

0 comments on commit 5f7834b

Please sign in to comment.