mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-24 14:24:47 +08:00
Fix dependency prefill issue
This commit is contained in:
parent
dab2c3ae7d
commit
de3c467f61
@ -126,8 +126,8 @@ function getBorderClasses(version: Version): string {
|
||||
<div class="flex flex-wrap items-center">
|
||||
<span class="text-xl md:basis-full">{{ item.name }}</span>
|
||||
<Tag :name="item.channel.name" :color="{ background: item.channel.color }" />
|
||||
<IconMdiCancel v-if="item.visibility === Visibility.SOFT_DELETE"></IconMdiCancel>
|
||||
<IconMdiEyeOff v-else-if="item.visibility !== Visibility.PUBLIC"></IconMdiEyeOff>
|
||||
<IconMdiCancel v-if="item.visibility === Visibility.SOFT_DELETE" class="ml-1"></IconMdiCancel>
|
||||
<IconMdiEyeOff v-else-if="item.visibility !== Visibility.PUBLIC" class="ml-1"></IconMdiEyeOff>
|
||||
</div>
|
||||
</div>
|
||||
<div class="basis-3/12 <md:(mt-2 basis-6/12)">
|
||||
|
@ -146,11 +146,15 @@ async function createPendingVersion() {
|
||||
}
|
||||
|
||||
async function createVersion() {
|
||||
if (!pendingVersion.value) return false;
|
||||
if (!pendingVersion.value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
loading.submit = true;
|
||||
pendingVersion.value!.description = descriptionEditor.value.rawEdited;
|
||||
pendingVersion.value!.channelColor = currentChannel.value!.color;
|
||||
pendingVersion.value!.channelFlags = currentChannel.value!.flags;
|
||||
|
||||
// played around trying to get this to happen in jackson's deserialization, but couldn't figure it out.
|
||||
for (const platform in pendingVersion.value.platformDependencies) {
|
||||
if (pendingVersion.value!.platformDependencies[platform as Platform].length < 1) {
|
||||
@ -162,9 +166,14 @@ async function createVersion() {
|
||||
delete pendingVersion.value!.pluginDependencies[platform as Platform];
|
||||
}
|
||||
}
|
||||
console.log("pending", pendingVersion.value);
|
||||
console.log("editor", descriptionEditor.value);
|
||||
console.log("rawEdited", descriptionEditor.value.rawEdited);
|
||||
|
||||
for (const platform in pendingVersion.value.platformDependencies) {
|
||||
if (!selectedPlatforms.value.includes(platform as Platform)) {
|
||||
delete pendingVersion.value.platformDependencies[platform as Platform];
|
||||
delete pendingVersion.value.pluginDependencies[platform as Platform];
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await useInternalApi(`versions/version/${props.project.id}/create`, true, "post", pendingVersion.value);
|
||||
await router.push(`/${route.params.user}/${route.params.project}/versions`);
|
||||
|
Loading…
Reference in New Issue
Block a user