Skip to content

Commit 654b7e4

Browse files
fix: handle exactOptionalPropertyTypes for symlogLinearThreshold in profile effects
Only set symlogLinearThreshold on the action payload when the profile field is defined, avoiding passing undefined to an optional property which violates exactOptionalPropertyTypes. Co-authored-by: Samuel <samuel@knutsen.co>
1 parent 4acef8d commit 654b7e4

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tensorbored/webapp/profile/effects/profile_effects.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ export class ProfileEffects {
308308
JSON.stringify(pinnedCards)
309309
);
310310

311-
return metricsActions.profileMetricsSettingsApplied({
311+
const actionPayload: Parameters<
312+
typeof metricsActions.profileMetricsSettingsApplied
313+
>[0] = {
312314
pinnedCards,
313315
superimposedCards: profile.superimposedCards.map((card) => ({
314316
id: card.id,
@@ -318,8 +320,11 @@ export class ProfileEffects {
318320
})),
319321
tagFilter,
320322
smoothing: profile.smoothing,
321-
symlogLinearThreshold: profile.symlogLinearThreshold,
322-
});
323+
};
324+
if (profile.symlogLinearThreshold !== undefined) {
325+
actionPayload.symlogLinearThreshold = profile.symlogLinearThreshold;
326+
}
327+
return metricsActions.profileMetricsSettingsApplied(actionPayload);
323328
})
324329
)
325330
);

0 commit comments

Comments
 (0)