Skip to content

Commit 756fafd

Browse files
authored
fix(addons): Show connected addon icon after oauth (#833)
1 parent 6a2d78e commit 756fafd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/app/shared/stores/addons/addons.state.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ describe('State: Addons', () => {
370370
supportedFeatures: [],
371371
type: 'authorized-storage-accounts',
372372
credentialsFormat: '', // No credentialsFormat in a PATCH response
373-
iconUrl: '', // No iconUrl in a PATCH response
373+
iconUrl: 'https://osf.io/assets/images/logo.svg', // iconUrl should be preserved after OAuth PATCH response if it existed before
374374
})
375375
);
376376

src/app/shared/stores/addons/addons.state.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ export class AddonsState {
181181
const existing = state.authorizedStorageAddons.data.find(
182182
(existingAddon: AuthorizedAccountModel) => existingAddon.id === addon.id
183183
);
184+
185+
if (existing && !addon.iconUrl) {
186+
addon.iconUrl = existing.iconUrl;
187+
}
184188
const updatedData = existing
185189
? state.authorizedStorageAddons.data.map((existingAddon: AuthorizedAccountModel) =>
186190
existingAddon.id === addon.id ? { ...existingAddon, ...addon } : existingAddon

0 commit comments

Comments
 (0)