Skip to content

Commit

Permalink
fix(pin): can not pin project as user's setting is {}
Browse files Browse the repository at this point in the history
  • Loading branch information
hudy9x committed Mar 5, 2024
1 parent 8211627 commit 2054e4b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/shared-models/src/lib/projectPin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ const _updatePinSetting = async ({

if (!user) return

let settings = user.settings as unknown as UserSetting
const settings = user.settings as unknown as UserSetting

// set a default setting for pinned projects
console.log('settings', settings)
if (type === 'pin' && !settings) {
settings = {
pinnedProjects: []
}
if (type === 'pin' && !settings.pinnedProjects) {
settings.pinnedProjects = []
}

if (!settings || !settings.pinnedProjects) {
Expand Down

0 comments on commit 2054e4b

Please sign in to comment.