You've already forked AstralRinth
forked from didirus/AstralRinth
Merge tag 'v0.10.21' into beta
This commit is contained in:
@@ -85,6 +85,7 @@
|
||||
<ModpackPermissionsFlow
|
||||
v-model="modpackJudgements"
|
||||
:project-id="project.id"
|
||||
:project-updated="project.updated"
|
||||
@complete="handleModpackPermissionsComplete"
|
||||
/>
|
||||
</div>
|
||||
@@ -446,6 +447,11 @@ function resetProgress() {
|
||||
|
||||
localStorage.removeItem(`modpack-permissions-${props.project.id}`)
|
||||
localStorage.removeItem(`modpack-permissions-index-${props.project.id}`)
|
||||
|
||||
sessionStorage.removeItem(`modpack-permissions-data-${props.project.id}`)
|
||||
sessionStorage.removeItem(`modpack-permissions-permanent-no-${props.project.id}`)
|
||||
sessionStorage.removeItem(`modpack-permissions-updated-${props.project.id}`)
|
||||
|
||||
modpackPermissionsComplete.value = false
|
||||
modpackJudgements.value = {}
|
||||
|
||||
@@ -1331,6 +1337,11 @@ function clearProjectLocalStorage() {
|
||||
localStorage.removeItem(`moderation-actions-${props.project.slug}`)
|
||||
localStorage.removeItem(`moderation-inputs-${props.project.slug}`)
|
||||
localStorage.removeItem(`moderation-stage-${props.project.slug}`)
|
||||
|
||||
sessionStorage.removeItem(`modpack-permissions-data-${props.project.id}`)
|
||||
sessionStorage.removeItem(`modpack-permissions-permanent-no-${props.project.id}`)
|
||||
sessionStorage.removeItem(`modpack-permissions-updated-${props.project.id}`)
|
||||
|
||||
actionStates.value = {}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ import { computed, onMounted, ref, watch } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
projectId: string
|
||||
projectUpdated: string
|
||||
modelValue?: ModerationJudgements
|
||||
}>()
|
||||
|
||||
@@ -202,6 +203,10 @@ const permanentNoFiles = useSessionStorage<ModerationModpackItem[]>(
|
||||
},
|
||||
},
|
||||
)
|
||||
const cachedProjectUpdated = useSessionStorage<string | null>(
|
||||
`modpack-permissions-updated-${props.projectId}`,
|
||||
null,
|
||||
)
|
||||
const currentIndex = ref(0)
|
||||
|
||||
const fileApprovalTypes: ModerationModpackPermissionApprovalType[] = [
|
||||
@@ -363,11 +368,13 @@ async function fetchModPackData(): Promise<void> {
|
||||
}
|
||||
|
||||
modPackData.value = sortedData
|
||||
cachedProjectUpdated.value = props.projectUpdated
|
||||
persistAll()
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch modpack data:', error)
|
||||
modPackData.value = []
|
||||
permanentNoFiles.value = []
|
||||
cachedProjectUpdated.value = props.projectUpdated
|
||||
persistAll()
|
||||
}
|
||||
}
|
||||
@@ -457,7 +464,10 @@ function getJudgements(): ModerationJudgements {
|
||||
|
||||
onMounted(() => {
|
||||
loadPersistedData()
|
||||
if (!modPackData.value) {
|
||||
|
||||
const isStale = cachedProjectUpdated.value !== props.projectUpdated
|
||||
|
||||
if (!modPackData.value || isStale) {
|
||||
fetchModPackData()
|
||||
}
|
||||
})
|
||||
@@ -477,6 +487,7 @@ watch(
|
||||
() => props.projectId,
|
||||
() => {
|
||||
clearPersistedData()
|
||||
cachedProjectUpdated.value = null
|
||||
loadPersistedData()
|
||||
if (!modPackData.value) {
|
||||
fetchModPackData()
|
||||
|
||||
@@ -84,16 +84,19 @@
|
||||
@change="uploadFile"
|
||||
/>
|
||||
<div
|
||||
class="absolute top-0 hidden size-[6rem] flex-col items-center justify-center rounded-xl bg-button-bg p-2 opacity-80 group-hover:flex"
|
||||
class="absolute top-0 hidden size-24 flex-col items-center justify-center rounded-xl bg-button-bg p-2 opacity-80 group-hover:flex"
|
||||
>
|
||||
<EditIcon class="h-8 w-8 text-contrast" />
|
||||
</div>
|
||||
<ServerIcon :image="icon" />
|
||||
<ServerIcon class="size-24" :image="icon" />
|
||||
</div>
|
||||
<ButtonStyled>
|
||||
<button v-tooltip="'Synchronize icon with installed modpack'" @click="resetIcon">
|
||||
<TransferIcon class="h-6 w-6" />
|
||||
<span>Sync icon</span>
|
||||
<button
|
||||
v-tooltip="'Synchronize icon with installed modpack'"
|
||||
class="my-auto"
|
||||
@click="resetIcon"
|
||||
>
|
||||
<TransferIcon /> Sync icon
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
@@ -112,8 +115,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { EditIcon, ServerIcon, TransferIcon } from '@modrinth/assets'
|
||||
import { injectNotificationManager } from '@modrinth/ui'
|
||||
import { EditIcon, TransferIcon } from '@modrinth/assets'
|
||||
import { injectNotificationManager, ServerIcon } from '@modrinth/ui'
|
||||
import ButtonStyled from '@modrinth/ui/src/components/base/ButtonStyled.vue'
|
||||
|
||||
import SaveBanner from '~/components/ui/servers/SaveBanner.vue'
|
||||
|
||||
@@ -304,7 +304,13 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="route.params.projectType !== 'collections'" class="error">
|
||||
<div
|
||||
v-else-if="
|
||||
(route.params.projectType && route.params.projectType !== 'collections') ||
|
||||
(!route.params.projectType && collections.length === 0)
|
||||
"
|
||||
class="error"
|
||||
>
|
||||
<UpToDate class="icon" />
|
||||
<br />
|
||||
<span v-if="auth.user && auth.user.id === user.id" class="preserve-lines text">
|
||||
|
||||
Reference in New Issue
Block a user