mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
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:
@@ -6,7 +6,7 @@ import { ObjectUpdatesService } from '../../../core/data/object-updates/object-u
|
|||||||
import { ActivatedRoute, Router, Data } from '@angular/router';
|
import { ActivatedRoute, Router, Data } from '@angular/router';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { first, map, switchMap, tap } from 'rxjs/operators';
|
import { take, map, switchMap, tap } from 'rxjs/operators';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { AbstractTrackableComponent } from '../../../shared/trackable/abstract-trackable.component';
|
import { AbstractTrackableComponent } from '../../../shared/trackable/abstract-trackable.component';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
@@ -85,7 +85,7 @@ export class AbstractItemUpdateComponent extends AbstractTrackableComponent impl
|
|||||||
if (this.url.indexOf('?') > 0) {
|
if (this.url.indexOf('?') > 0) {
|
||||||
this.url = this.url.substr(0, this.url.indexOf('?'));
|
this.url = this.url.substr(0, this.url.indexOf('?'));
|
||||||
}
|
}
|
||||||
this.hasChanges().pipe(first()).subscribe((hasChanges) => {
|
this.hasChanges().pipe(take(1)).subscribe((hasChanges) => {
|
||||||
if (!hasChanges) {
|
if (!hasChanges) {
|
||||||
this.initializeOriginalFields();
|
this.initializeOriginalFields();
|
||||||
} else {
|
} else {
|
||||||
@@ -170,7 +170,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'));
|
||||||
|
Reference in New Issue
Block a user