diff --git a/packages/shared-models/src/lib/projectPin.ts b/packages/shared-models/src/lib/projectPin.ts index 90249772..9fb2e487 100644 --- a/packages/shared-models/src/lib/projectPin.ts +++ b/packages/shared-models/src/lib/projectPin.ts @@ -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) {