private void UpdateStatusMessage()
        {
            var tab = m_PackageFiltering.currentFilterTab;

            if (m_PageManager.IsRefreshInProgress(tab))
            {
                SetStatusMessage(StatusType.Loading, L10n.Tr("Refreshing packages..."));
                return;
            }

            var errorMessage = string.Empty;

            if (!m_Application.isInternetReachable)
            {
                errorMessage = L10n.Tr(k_OfflineErrorMessage);
            }
            else if (m_PageManager.GetRefreshError(tab) != null)
            {
                errorMessage = L10n.Tr("Error refreshing packages, see console");
            }

            if (!string.IsNullOrEmpty(errorMessage))
            {
                SetStatusMessage(StatusType.Error, errorMessage);
                return;
            }

            var timestamp = m_PageManager.GetRefreshTimestamp(tab);
            var dt        = new DateTime(timestamp);
            var label     = timestamp == 0L ? string.Empty : L10n.Tr($"Last update {dt.ToString("MMM d, HH:mm", CultureInfo.CreateSpecificCulture("en-US"))}");

            SetStatusMessage(StatusType.Normal, label);
        }
Exemple #2
0
        private void RefreshList(bool updateScrollPosition)
        {
            if (m_PackageFiltering.currentFilterTab == PackageFilterTab.AssetStore && !m_UnityConnect.isUserLoggedIn)
            {
                HidePackagesShowLogin();
                return;
            }

            var page                  = m_PageManager.GetCurrentPage();
            var isListEmpty           = !page.visualStates.Any(v => v.visible);
            var isInitialFetchingDone = m_PageManager.IsInitialFetchingDone();

            if (isListEmpty || !isInitialFetchingDone)
            {
                HidePackagesShowMessage(m_PageManager.IsRefreshInProgress(), isInitialFetchingDone);
                return;
            }

            ShowPackages(updateScrollPosition);
        }