끝난 이클립스 합류 문구 · HOME 헤더 POP · 다국어 HOME 레이아웃 · 캠페인 표시 수정
This commit is contained in:
@@ -21,6 +21,23 @@ String liveEventMessage(LiveEvent event) => switch (event.kind) {
|
||||
LiveEventKind.notice => '[LIVE] ${event.nickname}',
|
||||
};
|
||||
|
||||
/// 띠·섬광 배너에 올려도 되는 라이브 이벤트. 이클립스 방어 합류는 **그 회차가 진행 중일 때만** 싣는다 —
|
||||
/// 끝난 회차의 합류 문구가 서버 TTL(1시간)까지 띠에 남던 결함(10/8 r11 2-5). [eclipse] 는 지금 진행 중인
|
||||
/// 회차(`watch` 는 마감되면 null 을 낸다)이고, 회차 발생 전의 합류는 지난 회차의 것이다.
|
||||
List<LiveEvent> liveEventsFor(
|
||||
List<LiveEvent> events,
|
||||
EclipseState? eclipse,
|
||||
DateTime now,
|
||||
) => [
|
||||
for (final e in events)
|
||||
if (e.kind != LiveEventKind.eclipseDefense ||
|
||||
(eclipse != null &&
|
||||
eclipse.result == null &&
|
||||
!eclipse.isExpired(now) &&
|
||||
!(eclipse.startAt?.isAfter(e.at) ?? false)))
|
||||
e,
|
||||
];
|
||||
|
||||
/// 홈 라이브 띠(전광판)에 올릴 한 줄. [hero] 면 띠가 HERO TIME 참여 진입이 된다.
|
||||
/// [push] 는 같은 사건을 알리는 Push 의 `kind` — 띠가 떠 있으면 앱 안 Push 를 겹쳐 띄우지 않는다(v1.5 §1.1).
|
||||
typedef TickerLine = ({String text, bool hero, String? push});
|
||||
@@ -46,7 +63,8 @@ TickerLine? tickerLine({
|
||||
required DateTime now,
|
||||
String? fallback,
|
||||
}) {
|
||||
final event = events.isEmpty ? null : events.first;
|
||||
final live = liveEventsFor(events, eclipse, now);
|
||||
final event = live.isEmpty ? null : live.first;
|
||||
if (eclipse != null && eclipse.result == null) {
|
||||
final started = eclipse.startAt;
|
||||
if (event == null || started == null || event.at.isBefore(started)) {
|
||||
|
||||
Reference in New Issue
Block a user