diff --git a/apps/frontend/src/pages/settings/billing/index.vue b/apps/frontend/src/pages/settings/billing/index.vue
index 9c93f1940..bfba19d51 100644
--- a/apps/frontend/src/pages/settings/billing/index.vue
+++ b/apps/frontend/src/pages/settings/billing/index.vue
@@ -257,7 +257,7 @@
v-else-if="getPyroCharge(subscription).status === 'processing'"
class="text-sm text-orange"
>
- Your payment is being processed. Perks will activate once payment is
+ Your payment is being processed. Your server will activate once payment is
complete.
- Your subscription payment failed. Please update your payment method.
+ Your subscription payment failed. Please update your payment method, then
+ resubscribe.
@@ -278,7 +279,8 @@
crate::Result<()> {
- let mmc_instance_path = mmc_base_path
- .join("instances")
- .join(instance_folder.clone());
+ let mmc_instance_path =
+ mmc_base_path.join("instances").join(instance_folder);
let mmc_pack =
io::read_to_string(&mmc_instance_path.join("mmc-pack.json")).await?;
@@ -209,9 +208,18 @@ pub async fn import_mmc(
profile_path: profile_path.to_string(),
};
- // Managed pack
- let backup_name = "Imported Modpack".to_string();
+ let mut minecraft_folder = mmc_instance_path.join("minecraft");
+ if !minecraft_folder.is_dir() {
+ minecraft_folder = mmc_instance_path.join(".minecraft");
+ if !minecraft_folder.is_dir() {
+ return Err(crate::ErrorKind::InputError(
+ "Instance is missing Minecraft directory".to_string(),
+ )
+ .into());
+ }
+ }
+ // Managed pack
if instance_cfg.managed_pack.unwrap_or(false) {
match instance_cfg.managed_pack_type {
Some(MMCManagedPackType::Modrinth) => {
@@ -220,38 +228,26 @@ pub async fn import_mmc(
// Modrinth Managed Pack
// Kept separate as we may in the future want to add special handling for modrinth managed packs
- let backup_name = "Imported Modrinth Modpack".to_string();
- let minecraft_folder = mmc_base_path.join("instances").join(instance_folder).join(".minecraft");
- import_mmc_unmanaged(profile_path, minecraft_folder, backup_name, description, mmc_pack).await?;
+ import_mmc_unmanaged(profile_path, minecraft_folder, "Imported Modrinth Modpack".to_string(), description, mmc_pack).await?;
}
Some(MMCManagedPackType::Flame) | Some(MMCManagedPackType::ATLauncher) => {
// For flame/atlauncher managed packs
// Treat as unmanaged, but with 'minecraft' folder instead of '.minecraft'
- let minecraft_folder = mmc_base_path.join("instances").join(instance_folder).join("minecraft");
- import_mmc_unmanaged(profile_path, minecraft_folder, backup_name, description, mmc_pack).await?;
+ import_mmc_unmanaged(profile_path, minecraft_folder, "Imported Modpack".to_string(), description, mmc_pack).await?;
},
Some(_) => {
// For managed packs that aren't modrinth, flame, atlauncher
// Treat as unmanaged
- let backup_name = "ImportedModpack".to_string();
- let minecraft_folder = mmc_base_path.join("instances").join(instance_folder).join(".minecraft");
- import_mmc_unmanaged(profile_path, minecraft_folder, backup_name, description, mmc_pack).await?;
+ import_mmc_unmanaged(profile_path, minecraft_folder, "ImportedModpack".to_string(), description, mmc_pack).await?;
},
- _ => return Err(crate::ErrorKind::InputError({
- "Instance is managed, but managed pack type not specified in instance.cfg".to_string()
- }).into())
+ _ => return Err(crate::ErrorKind::InputError("Instance is managed, but managed pack type not specified in instance.cfg".to_string()).into())
}
} else {
// Direclty import unmanaged pack
- let backup_name = "Imported Modpack".to_string();
- let minecraft_folder = mmc_base_path
- .join("instances")
- .join(instance_folder)
- .join(".minecraft");
import_mmc_unmanaged(
profile_path,
minecraft_folder,
- backup_name,
+ "Imported Modpack".to_string(),
description,
mmc_pack,
)
diff --git a/packages/ui/src/components/base/OverflowMenu.vue b/packages/ui/src/components/base/OverflowMenu.vue
index cf0b04f84..59316c5f8 100644
--- a/packages/ui/src/components/base/OverflowMenu.vue
+++ b/packages/ui/src/components/base/OverflowMenu.vue
@@ -10,7 +10,7 @@
@@ -25,15 +25,15 @@
:v-close-popper="!option.remainOnClick"
:action="
option.action
- ? (event) => {
- option.action(event)
+ ? (event: MouseEvent) => {
+ option.action?.(event)
if (!option.remainOnClick) {
close()
}
}
- : null
+ : undefined
"
- :link="option.link ? option.link : null"
+ :link="option.link ? option.link : undefined"
:external="option.external ? option.external : false"
:disabled="option.disabled"
@click="
@@ -67,7 +67,7 @@ interface Divider extends BaseOption {
interface Item extends BaseOption {
id: string
- action?: () => void
+ action?: (event?: MouseEvent) => void
link?: string
external?: boolean
color?:
@@ -99,8 +99,8 @@ withDefaults(
{
options: () => [],
disabled: false,
- dropdownId: null,
- tooltip: null,
+ dropdownId: undefined,
+ tooltip: undefined,
},
)
@@ -118,6 +118,10 @@ const open = () => {
dropdown.value?.show()
}
+function isDivider(option: BaseOption): option is Divider {
+ return 'divider' in option
+}
+
defineExpose({ open, close })