export type RefreshPresentation = { showFullPageLoading: boolean statusUpdating: boolean treatAsOffline: boolean } export function whileRefreshing(hasCachedSeries: boolean): RefreshPresentation { return { showFullPageLoading: false, statusUpdating: hasCachedSeries, treatAsOffline: false, } } export function afterRefresh(input: { hasCachedSeries: boolean fetchSucceeded: boolean networkOnline: boolean }): RefreshPresentation { if (input.fetchSucceeded) { return { showFullPageLoading: false, statusUpdating: false, treatAsOffline: false, } } return { showFullPageLoading: false, statusUpdating: false, treatAsOffline: !input.networkOnline || input.hasCachedSeries, } }