Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/app-frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import { get_user, get_version } from '@/helpers/cache.js'
import { command_listener, warning_listener } from '@/helpers/events.js'
import { cancelLogin, get as getCreds, login, logout } from '@/helpers/mr_auth.ts'
import { create_profile_and_install_from_file } from '@/helpers/pack'
import { list } from '@/helpers/profile.js'
import { list, run } from '@/helpers/profile.js'
import { mergeUrlQuery, parseModrinthLink } from '@/helpers/project-links.ts'
import { get as getSettings, set as setSettings } from '@/helpers/settings.ts'
import { get_opening_command, initialize_state } from '@/helpers/state'
Expand Down Expand Up @@ -796,6 +796,8 @@ async function handleCommand(e) {
source: 'CreationModalFileDrop',
})
}
} else if (e.event === 'LaunchProfile') {
await run(e.path).catch(handleError)
} else if (e.event === 'InstallServer') {
await router.push(`/project/${e.id}`)
await playServerProject(e.id).catch(handleError)
Expand Down
4 changes: 4 additions & 0 deletions packages/app-lib/src/api/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ pub async fn handle_url(sublink: &str) -> crate::Result<CommandPayload> {
Some(("server", id)) => {
CommandPayload::InstallServer { id: id.to_string() }
}
// /launch/{id} - Launches a profile
Some(("launch", id)) => CommandPayload::LaunchProfile {
path: id.to_string(),
},
_ => {
emit_warning(&format!(
"Invalid command, unrecognized path: {sublink}"
Expand Down
3 changes: 3 additions & 0 deletions packages/app-lib/src/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ pub enum CommandPayload {
InstallServer {
id: String,
},
LaunchProfile {
path: String,
},
RunMRPack {
// run or install .mrpack
path: PathBuf,
Expand Down