Skip to content

Commit 101a669

Browse files
committed
chore: service object update
1 parent 4b3c3cb commit 101a669

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/Shared/Services/common.service.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,19 @@ export const updateUserPreferences = async (
113113
): Promise<boolean> => {
114114
try {
115115
let value: UserPreferencesPayloadValueType = null
116-
const { themePreference, appTheme, pipelineRBACViewSelectedTab } = updatedUserPreferences
117-
value = {
118-
viewPermittedEnvOnly: pipelineRBACViewSelectedTab === ViewIsPipelineRBACConfiguredRadioTabs.ACCESS_ONLY,
119-
computedAppTheme: themePreference === THEME_PREFERENCE_MAP.auto ? `system-${appTheme}` : appTheme,
116+
if (updatedUserPreferences) {
117+
const { themePreference, appTheme, pipelineRBACViewSelectedTab } = updatedUserPreferences
118+
119+
value = {
120+
viewPermittedEnvOnly: pipelineRBACViewSelectedTab === ViewIsPipelineRBACConfiguredRadioTabs.ACCESS_ONLY,
121+
computedAppTheme: themePreference === THEME_PREFERENCE_MAP.auto ? `system-${appTheme}` : appTheme,
122+
}
120123
}
124+
121125
if (recentlyVisitedDevtronApps?.length) {
122-
value.resources = resourcesObj(recentlyVisitedDevtronApps)
126+
value = {
127+
resources: resourcesObj(recentlyVisitedDevtronApps),
128+
}
123129
}
124130

125131
const payload: UpdateUserPreferencesPayloadType = {

0 commit comments

Comments
 (0)