Skip to content

Commit

Permalink
fix: The authlib-injector config is not respected
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Feb 20, 2024
1 parent 7f754f1 commit 1a60f2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xmcl-keystone-ui/src/composables/instanceLaunch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const kInstanceLaunch: InjectionKey<ReturnType<typeof useInstanceLaunch>>
export function useInstanceLaunch(instance: Ref<Instance>, resolvedVersion: Ref<ResolvedVersion | { requirements: Record<string, any> } | undefined>, java: Ref<JavaRecord | undefined>, userProfile: Ref<UserProfile>, globalState: ReturnType<typeof useSettingsState>) {
const { refreshUser } = useService(UserServiceKey)
const { launch, kill, on, getGameProcesses, reportOperation } = useService(LaunchServiceKey)
const { globalAssignMemory, globalMaxMemory, globalMinMemory, globalMcOptions, globalVmOptions, globalFastLaunch, globalHideLauncher, globalShowLog } = useGlobalSettings(globalState)
const { globalAssignMemory, globalMaxMemory, globalMinMemory, globalMcOptions, globalVmOptions, globalFastLaunch, globalHideLauncher, globalShowLog, globalDisableAuthlibInjector } = useGlobalSettings(globalState)
const { getMemoryStatus } = useService(BaseServiceKey)
const { abortRefresh } = useService(UserServiceKey)
const { getOrInstallAuthlibInjector, abortAuthlibInjectorInstall } = useService(AuthlibInjectorServiceKey)
Expand Down Expand Up @@ -100,15 +100,18 @@ export function useInstanceLaunch(instance: Ref<Instance>, resolvedVersion: Ref<
let yggdrasilAgent: LaunchOptions['yggdrasilAgent']

const authority = tryParseUrl(userProfile.value.authority)
if (authority && (authority.protocol === 'http:' || authority?.protocol === 'https:' || userProfile.value.authority === AUTHORITY_DEV)) {

const inst = instance.value

const disableAuthlibInjector = inst.disableAuthlibInjector ?? globalDisableAuthlibInjector.value
if (!disableAuthlibInjector && authority && (authority.protocol === 'http:' || authority?.protocol === 'https:' || userProfile.value.authority === AUTHORITY_DEV)) {
launchingStatus.value = 'preparing-authlib'
yggdrasilAgent = {
jar: await track(getOrInstallAuthlibInjector(), 'prepare-authlib', id),
server: userProfile.value.authority,
}
}

const inst = instance.value
const assignMemory = inst.assignMemory ?? globalAssignMemory.value
const hideLauncher = inst.hideLauncher ?? globalHideLauncher.value
const showLog = inst.showLog ?? globalShowLog.value
Expand Down

0 comments on commit 1a60f2d

Please sign in to comment.