Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/shared/stores/addons/addons.state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ describe('State: Addons', () => {
supportedFeatures: [],
type: 'authorized-storage-accounts',
credentialsFormat: '', // No credentialsFormat in a PATCH response
iconUrl: '', // No iconUrl in a PATCH response
iconUrl: 'https://osf.io/assets/images/logo.svg', // iconUrl should be preserved after OAuth PATCH response if it existed before
})
);

Expand Down
4 changes: 4 additions & 0 deletions src/app/shared/stores/addons/addons.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ export class AddonsState {
const existing = state.authorizedStorageAddons.data.find(
(existingAddon: AuthorizedAccountModel) => existingAddon.id === addon.id
);

if (existing && !addon.iconUrl) {
addon.iconUrl = existing.iconUrl;
}
const updatedData = existing
? state.authorizedStorageAddons.data.map((existingAddon: AuthorizedAccountModel) =>
existingAddon.id === addon.id ? { ...existingAddon, ...addon } : existingAddon
Expand Down