fix: detail view should not reuse things without references

This commit is contained in:
2023-10-05 15:33:08 +02:00
committed by Thea Schöbl
parent 9e6d4fe054
commit 3a79d57c8d
3 changed files with 5 additions and 6 deletions

View File

@@ -93,6 +93,11 @@ export class DataDetailComponent implements OnInit {
translateService: TranslateService, translateService: TranslateService,
) { ) {
this.inputItem = router.getCurrentNavigation()?.extras.state?.item; this.inputItem = router.getCurrentNavigation()?.extras.state?.item;
if (!this.inputItem?.origin) {
// We received a ThingWithoutReferences.
// This can happen, for example, when detail views use `inPlace` list items
delete this.inputItem;
}
this.language = translateService.currentLang as SCLanguageCode; this.language = translateService.currentLang as SCLanguageCode;
translateService.onLangChange.subscribe((event: LangChangeEvent) => { translateService.onLangChange.subscribe((event: LangChangeEvent) => {
this.language = event.lang as SCLanguageCode; this.language = event.lang as SCLanguageCode;

View File

@@ -228,10 +228,6 @@ export class SearchPageComponent implements OnInit {
this.updateContextFilter(result.facets); this.updateContextFilter(result.facets);
this.items = Promise.resolve(result.data); this.items = Promise.resolve(result.data);
} }
this.items.then(it => {
if (it.length === result.pagination.total) console.log('final page loaded');
});
} catch (error) { } catch (error) {
this.logger.error(error); this.logger.error(error);
} finally { } finally {

View File

@@ -105,11 +105,9 @@ export class PositionService {
subscriber.next(this.position); subscriber.next(this.position);
} }
}); });
watcherID.then(console.log);
return { return {
unsubscribe() { unsubscribe() {
watcherID.then(id => { watcherID.then(id => {
console.log(id);
void Geolocation.clearWatch({id}); void Geolocation.clearWatch({id});
}); });
}, },