120109: Fixed "no elements in sequence" sometimes being thrown on the item bitstream & relationship tabs

(cherry picked from commit decacec404)
This commit is contained in:
Alexandre Vryghem
2024-11-19 18:14:12 +01:00
committed by github-actions[bot]
parent 9c843b62d4
commit c9ba47b9af

View File

@@ -16,9 +16,9 @@ import {
Subscription, Subscription,
} from 'rxjs'; } from 'rxjs';
import { import {
first,
map, map,
switchMap, switchMap,
take,
tap, tap,
} from 'rxjs/operators'; } from 'rxjs/operators';
@@ -102,7 +102,7 @@ export class AbstractItemUpdateComponent extends AbstractTrackableComponent impl
super.ngOnInit(); super.ngOnInit();
this.discardTimeOut = environment.item.edit.undoTimeout; this.discardTimeOut = environment.item.edit.undoTimeout;
this.hasChanges().pipe(first()).subscribe((hasChanges) => { this.hasChanges().pipe(take(1)).subscribe((hasChanges) => {
if (!hasChanges) { if (!hasChanges) {
this.initializeOriginalFields(); this.initializeOriginalFields();
} else { } else {
@@ -187,7 +187,7 @@ export class AbstractItemUpdateComponent extends AbstractTrackableComponent impl
*/ */
private checkLastModified() { private checkLastModified() {
const currentVersion = this.item.lastModified; const currentVersion = this.item.lastModified;
this.objectUpdatesService.getLastModified(this.url).pipe(first()).subscribe( this.objectUpdatesService.getLastModified(this.url).pipe(take(1)).subscribe(
(updateVersion: Date) => { (updateVersion: Date) => {
if (updateVersion.getDate() !== currentVersion.getDate()) { if (updateVersion.getDate() !== currentVersion.getDate()) {
this.notificationsService.warning(this.getNotificationTitle('outdated'), this.getNotificationContent('outdated')); this.notificationsService.warning(this.getNotificationTitle('outdated'), this.getNotificationContent('outdated'));