Skip to content
Snippets Groups Projects
Commit 19a2ae6e authored by Kristof De Langhe's avatar Kristof De Langhe
Browse files

65240: ComCol logo caching issue fix

parent 1fafc3a5
No related branches found
No related tags found
No related merge requests found
......@@ -182,7 +182,7 @@ export class ComColFormComponent<T extends DSpaceObject> implements OnInit, OnDe
});
this.submitForm.emit({
dso: updatedDSO,
uploader: this.uploaderComponent.uploader
uploader: hasValue(this.uploaderComponent) ? this.uploaderComponent.uploader : undefined
});
}
......@@ -221,7 +221,7 @@ export class ComColFormComponent<T extends DSpaceObject> implements OnInit, OnDe
errorResponse.errorMessage
);
}
this.refreshCache();
(this.dso as any).logo = undefined;
});
}
}
......@@ -230,7 +230,6 @@ export class ComColFormComponent<T extends DSpaceObject> implements OnInit, OnDe
* Refresh the object's cache to ensure the latest version
*/
private refreshCache() {
(this.dso as any).logo = undefined;
this.requestService.removeByHrefSubstring(this.dso.self);
this.objectCache.remove(this.dso.self);
}
......
......@@ -5,7 +5,7 @@ import { RemoteData } from '../../../../core/data/remote-data';
import { ActivatedRoute, Router } from '@angular/router';
import { first, map, take } from 'rxjs/operators';
import { getSucceededRemoteData } from '../../../../core/shared/operators';
import { isNotUndefined } from '../../../empty.util';
import { hasValue, isNotUndefined } from '../../../empty.util';
import { DataService } from '../../../../core/data/data.service';
import { ResourceType } from '../../../../core/shared/resource-type';
import { ComColDataService } from '../../../../core/data/comcol-data.service';
......@@ -57,14 +57,14 @@ export class ComcolMetadataComponent<TDomain extends DSpaceObject> implements On
.subscribe((dsoRD: RemoteData<TDomain>) => {
if (isNotUndefined(dsoRD)) {
const newUUID = dsoRD.payload.uuid;
if (uploader.queue.length > 0) {
if (hasValue(uploader) && uploader.queue.length > 0) {
this.dsoDataService.getLogoEndpoint(newUUID).pipe(take(1)).subscribe((href: string) => {
uploader.options.url = href;
uploader.uploadAll();
});
} else {
this.router.navigate([this.frontendURL + newUUID]);
}
this.router.navigate([this.frontendURL + newUUID]);
}
this.notificationsService.success(null, this.translate.get(this.type.value + '.edit.notifications.success'));
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment