Skip to content

Commit afaee4a

Browse files
ref(avatar): Remove unused savedDataUrl prop (#93747)
This prop isn't being used for anything and only serves to confuse us
1 parent 39eef6f commit afaee4a

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

static/app/components/avatarChooser.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ interface AvatarChooserProps {
4949
disabled?: boolean;
5050
help?: React.ReactNode;
5151
onSave?: (model: Model) => void;
52-
savedDataUrl?: string;
5352
title?: string;
5453
type?: AvatarChooserType;
5554
uploadDomain?: string;
@@ -59,7 +58,6 @@ function AvatarChooser(props: AvatarChooserProps) {
5958
const {
6059
endpoint,
6160
model: propsModel,
62-
savedDataUrl,
6361
disabled,
6462
title,
6563
help,
@@ -204,7 +202,6 @@ function AvatarChooser(props: AvatarChooserProps) {
204202
{...props}
205203
type={type}
206204
model={model}
207-
savedDataUrl={savedDataUrl}
208205
uploadDomain={uploadDomain ?? ''}
209206
updateDataUrlState={({dataUrl: newDataUrl}) =>
210207
setNewAvatar(newDataUrl ?? null)

static/app/components/avatarUploader.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ type Props = {
5151
| 'sentryAppColor'
5252
| 'sentryAppSimple'
5353
| 'docIntegration';
54-
updateDataUrlState: (opts: {dataUrl?: string; savedDataUrl?: string | null}) => void;
54+
updateDataUrlState: (opts: {dataUrl?: string}) => void;
5555
uploadDomain: string;
56-
savedDataUrl?: string;
5756
};
5857

5958
type State = {
@@ -97,9 +96,8 @@ class AvatarUploader extends Component<Props, State> {
9796

9897
this.revokeObjectUrl();
9998

100-
const {updateDataUrlState} = this.props;
10199
const objectURL = window.URL.createObjectURL(file);
102-
this.setState({file, objectURL}, () => updateDataUrlState({savedDataUrl: null}));
100+
this.setState({file, objectURL});
103101
};
104102

105103
revokeObjectUrl = () =>
@@ -353,12 +351,12 @@ class AvatarUploader extends Component<Props, State> {
353351
}
354352

355353
get imageSrc() {
356-
const {savedDataUrl, model, type, uploadDomain} = this.props;
354+
const {model, type, uploadDomain} = this.props;
357355
const uuid = model.avatar?.avatarUuid;
358356
const photoUrl =
359357
uuid && `${uploadDomain}/${AVATAR_URL_MAP[type] || 'avatar'}/${uuid}/`;
360358

361-
return savedDataUrl || this.state.objectURL || photoUrl;
359+
return this.state.objectURL || photoUrl;
362360
}
363361

364362
uploadClick = (ev: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {

static/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ export default function SentryApplicationDetails(props: Props) {
403403
help={AVATAR_STYLES[avatarStyle].help.concat(
404404
isInternal() ? '' : t(' Required for publishing.')
405405
)}
406-
savedDataUrl={undefined}
407406
defaultChoice={{
408407
choiceText: isColor ? t('Default logo') : t('Default small icon'),
409408
preview: getAvatarPreview(isColor),

0 commit comments

Comments
 (0)