Skip to content

Commit

Permalink
Display information about mod list updating being prevented while the…
Browse files Browse the repository at this point in the history
…re are downloads in progress
  • Loading branch information
VilppeRiskidev committed Feb 26, 2025
1 parent 5d0995b commit 49bfdc2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
9 changes: 8 additions & 1 deletion src/components/ModListUpdateBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ export default class ModListUpdateBanner extends Vue {

<template>
<div v-if="!isModListLoaded" id="mod-list-update-banner" class="margin-bottom">
<div class="notification is-warning margin-right">
<div v-if="$store.getters['download/activeDownloadCount'] > 0" class="notification is-warning margin-right">
<span>
An error occurred when updating the mod list from Thunderstore.<br />
However, the mod list can't be updated while the are mod downloads in progress.<br />
Please wait for the downloads to finish before continuing.
</span>
</div>
<div v-else class="notification is-warning margin-right">
<span v-if="isUpdateInProgress">
{{ $store.state.tsMods.thunderstoreModListUpdateStatus }}
</span>
Expand Down
45 changes: 27 additions & 18 deletions src/components/profiles-modals/ImportProfileModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,24 +326,33 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
<p class="margin-top">
Updating the mod list from Thunderstore might solve this issue.

<span v-if="$store.state.tsMods.modsLastUpdated">
The mod list was last updated on {{ valueToReadableDate($store.state.tsMods.modsLastUpdated) }}.
</span>

<br />

<span v-if="$store.state.tsMods.isThunderstoreModListUpdateInProgress">
{{ $store.state.tsMods.thunderstoreModListUpdateStatus }}
</span>
<span v-else-if="$store.state.tsMods.thunderstoreModListUpdateError">
Error updating the mod list:
{{ $store.state.tsMods.thunderstoreModListUpdateError.message }}.
<a @click="$store.dispatch('tsMods/syncPackageList')">Retry</a>?
</span>
<span v-else>
Would you like to
<a @click="$store.dispatch('tsMods/syncPackageList')">update now</a>?
</span>
<div v-if="$store.getters['download/activeDownloadCount'] > 0">
<span>
However, the mod list can't be updated while the are mod downloads in progress.
Please wait for the downloads to finish before continuing.
</span>
</div>

<div v-else>
<span v-if="$store.state.tsMods.modsLastUpdated">
The mod list was last updated on {{ valueToReadableDate($store.state.tsMods.modsLastUpdated) }}.
</span>

<br />

<span v-if="$store.state.tsMods.isThunderstoreModListUpdateInProgress">
{{ $store.state.tsMods.thunderstoreModListUpdateStatus }}
</span>
<span v-else-if="$store.state.tsMods.thunderstoreModListUpdateError">
Error updating the mod list:
{{ $store.state.tsMods.thunderstoreModListUpdateError.message }}.
<a @click="$store.dispatch('tsMods/syncPackageList')">Retry</a>?
</span>
<span v-else>
Would you like to
<a @click="$store.dispatch('tsMods/syncPackageList')">update now</a>?
</span>
</div>
</p>
</div>
</template>
Expand Down
3 changes: 3 additions & 0 deletions src/components/settings-components/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ import CdnProvider from '../../providers/generic/connection/CdnProvider';
'Refresh online mod list',
'Check for any new mod releases.',
async () => {
if (this.$store.getters['download/activeDownloadCount'] > 0) {
return "Updating the mod list is disabled while there are active downloads.";
}
if (this.$store.state.tsMods.isThunderstoreModListUpdateInProgress) {
return this.$store.state.tsMods.thunderstoreModListUpdateStatus || "Updating...";
}
Expand Down

0 comments on commit 49bfdc2

Please sign in to comment.