added fileFetchedAt to TickerPageResponse and updated the Ticker UI to use it as the data currency timestamp for proxied files
This commit is contained in:
@@ -44,6 +44,12 @@ class TickerPageResponse {
|
||||
/// when the page has never been published.
|
||||
final String? publishedAt;
|
||||
|
||||
/// PROXIED_FILE only: ISO timestamp of the last successful re-fetch of the
|
||||
/// file by the server proxy (`ticker_pages.proxy_last_success_at`) — the
|
||||
/// document's data currency, shown as "Aktualisiert am …" instead of
|
||||
/// [publishedAt]. Null for other kinds / files never fetched yet.
|
||||
final String? fileFetchedAt;
|
||||
|
||||
TickerPageResponse({
|
||||
required this.schemaVersion,
|
||||
this.slug,
|
||||
@@ -58,6 +64,7 @@ class TickerPageResponse {
|
||||
this.hash,
|
||||
this.webUrl,
|
||||
this.publishedAt,
|
||||
this.fileFetchedAt,
|
||||
});
|
||||
|
||||
factory TickerPageResponse.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -21,6 +21,7 @@ TickerPageResponse _$TickerPageResponseFromJson(Map<String, dynamic> json) =>
|
||||
hash: json['hash'] as String?,
|
||||
webUrl: json['webUrl'] as String?,
|
||||
publishedAt: json['publishedAt'] as String?,
|
||||
fileFetchedAt: json['fileFetchedAt'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TickerPageResponseToJson(TickerPageResponse instance) =>
|
||||
@@ -38,4 +39,5 @@ Map<String, dynamic> _$TickerPageResponseToJson(TickerPageResponse instance) =>
|
||||
'hash': instance.hash,
|
||||
'webUrl': instance.webUrl,
|
||||
'publishedAt': instance.publishedAt,
|
||||
'fileFetchedAt': instance.fileFetchedAt,
|
||||
};
|
||||
|
||||
@@ -94,7 +94,9 @@ class _TickerPageContentState extends State<_TickerPageContent> {
|
||||
case TickerPageKind.proxiedFile:
|
||||
return Column(
|
||||
children: [
|
||||
TickerUpdatedBar(publishedAt: page.publishedAt),
|
||||
// For proxied files the data currency is the last successful
|
||||
// proxy fetch, not the page's publish date.
|
||||
TickerUpdatedBar(publishedAt: page.fileFetchedAt ?? page.publishedAt),
|
||||
Expanded(
|
||||
child: _ProxiedFileView(
|
||||
repo: context.read<TickerPageBloc>().repo,
|
||||
|
||||
Reference in New Issue
Block a user