Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
trholdridge committed Sep 27, 2024
1 parent 6b0441c commit e4a3854
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/workspaces/SettingsModal/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,7 @@ const SettingsModal = (props: SettingsModalProps): ReactNode => {
};

const getRequesterPaysSetting = (settings: WorkspaceSetting[]): RequesterPaysSetting | undefined => {
const requesterPaysSettings: RequesterPaysSetting[] = settings.filter((setting: WorkspaceSetting) =>
isRequesterPaysSetting(setting)
) as RequesterPaysSetting[];
if (requesterPaysSettings.length > 0) {
return requesterPaysSettings[0];
}
return undefined;
return settings.find((setting: WorkspaceSetting) => isRequesterPaysSetting(setting)) as RequesterPaysSetting;
};

useEffect(() => {
Expand Down Expand Up @@ -217,7 +211,7 @@ const SettingsModal = (props: SettingsModalProps): ReactNode => {
) {
// If the bucket had no soft delete setting before, and the current one is the default retention, don't event.
} else if (!_.isEqual(originalSoftDeleteSetting, newSoftDeleteSetting)) {
// Event if an explicit setting existed before and it changed.
// Event if the setting changed.
Ajax().Metrics.captureEvent(Events.workspaceSettingsSoftDelete, {
enabled: softDeleteEnabled,
retention: softDeleteRetention, // will be null if soft delete is disabled
Expand Down

0 comments on commit e4a3854

Please sign in to comment.