diff --git a/src/components/mixins/SplashMixin.vue b/src/components/mixins/SplashMixin.vue index 0f616adff..bd42600e9 100644 --- a/src/components/mixins/SplashMixin.vue +++ b/src/components/mixins/SplashMixin.vue @@ -32,6 +32,10 @@ export default class SplashMixin extends Vue { return this.requests.reduce((x, y) => x.merge(y)); } + resetRequestProgresses() { + this.requests.forEach((request) => request.setProgress(0)); + } + // Get the list of game-specific packages to exclude. async getExclusions() { this.loadingText = 'Connecting to GitHub repository'; @@ -76,7 +80,9 @@ export default class SplashMixin extends Vue { this.loadingText = 'You may be offline or Thunderstore is unavailabe. Checking cache.'; } + this.getRequestItem('CacheOperations').setProgress(50); await this.$store.dispatch('tsMods/updateMods'); + this.getRequestItem('CacheOperations').setProgress(100); if (this.$store.state.tsMods.modsLastUpdated === undefined) { this.heroTitle = 'Failed to get mods from Thunderstore and cache'; diff --git a/src/pages/Splash.vue b/src/pages/Splash.vue index 807e5ed06..fafbf81f4 100644 --- a/src/pages/Splash.vue +++ b/src/pages/Splash.vue @@ -159,7 +159,8 @@ export default class Splash extends mixins(SplashMixin) { requests = [ new RequestItem('UpdateCheck', 0), new RequestItem('ThunderstoreDownload', 0), - new RequestItem('ExclusionsList', 0) + new RequestItem('ExclusionsList', 0), + new RequestItem('CacheOperations', 0) ]; // Ensure that r2modman isn't outdated. @@ -194,9 +195,7 @@ export default class Splash extends mixins(SplashMixin) { } retryConnection() { - this.getRequestItem('UpdateCheck').setProgress(0); - this.getRequestItem('ExclusionsList').setProgress(0); - this.getRequestItem('ThunderstoreDownload').setProgress(0); + this.resetRequestProgresses(); this.isOffline = false; this.checkForUpdates(); }