mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-06 12:23:55 +00:00
News aren't available for events that aren't currently live
This commit is contained in:
1 parent
0c22cab55e
commit
356ea20537
2 files changed
+10
-5
No files matched your search
+1
-1
@@ -105,7 +105,7 @@ public class EventOverviewStage extends Composite {
|
||||
setStageData(new EventOverviewStageDTO(null, new EventOverviewTickerStageDTO(null, null, null)));
|
||||
}
|
||||
|
||||
if(news.isEmpty()) {
|
||||
if(news == null || news.isEmpty()) {
|
||||
updatesWrapperUi.getStyle().setDisplay(Display.NONE);
|
||||
stage.removeStyleName(mediaCss.medium7());
|
||||
stage.removeStyleName(mediaCss.large8());
|
||||
|
||||
+9
-4
@@ -10,6 +10,7 @@ import com.sap.sailing.gwt.ui.shared.dispatch.Action;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.DispatchContext;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.ListResult;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.ResultWithTTL;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.event.EventActionUtil.CalculationWithEvent;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.InfoNewsEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.LeaderboardNewsEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.news.NewsEntryDTO;
|
||||
@@ -35,10 +36,14 @@ public class GetEventOverviewNewsAction implements Action<ResultWithTTL<ListResu
|
||||
|
||||
@Override
|
||||
@GwtIncompatible
|
||||
public ResultWithTTL<ListResult<NewsEntryDTO>> execute(DispatchContext context) {
|
||||
Event event = context.getRacingEventService().getEvent(eventId);
|
||||
long ttl = 1000 * 60 * 2;
|
||||
return new ResultWithTTL<>(ttl, new ListResult<NewsEntryDTO>(getNews(context, event)));
|
||||
public ResultWithTTL<ListResult<NewsEntryDTO>> execute(final DispatchContext context) {
|
||||
return EventActionUtil.withLiveRaceOrDefaultSchedule(context, eventId, new CalculationWithEvent<ListResult<NewsEntryDTO>>() {
|
||||
@Override
|
||||
public ResultWithTTL<ListResult<NewsEntryDTO>> calculateWithEvent(Event event) {
|
||||
long ttl = 1000 * 60 * 2;
|
||||
return new ResultWithTTL<>(ttl, new ListResult<NewsEntryDTO>(getNews(context, event)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@GwtIncompatible
|
||||
|
||||
Reference in new issue
Block a user