@@ -21,6 +21,7 @@ import { getItemFromBlock } from './chatUtils'
2121import { gamepadUiCursorState , moveGamepadCursorByPx } from './react/GamepadUiCursor'
2222import { completeTexturePackInstall , resourcePackState } from './resourcePack'
2323import { showNotification } from './react/NotificationProvider'
24+ import { lastConnectOptions } from './react/AppStatusProvider'
2425
2526
2627export const customKeymaps = proxy ( JSON . parse ( localStorage . keymap || '{}' ) ) as UserOverridesConfig
@@ -303,15 +304,17 @@ function lockUrl () {
303304 newQs = `loadSave=${ save } `
304305 } else if ( process . env . NODE_ENV === 'development' ) {
305306 newQs = `reconnect=1`
306- } else {
307+ } else if ( lastConnectOptions . value ?. server ) {
307308 const qs = new URLSearchParams ( )
308- const { server, version } = localStorage
309+ const { server, botVersion } = lastConnectOptions . value
309310 qs . set ( 'server' , server )
310- if ( version ) qs . set ( 'version' , version )
311+ if ( botVersion ) qs . set ( 'version' , botVersion )
311312 newQs = String ( qs . toString ( ) )
312313 }
313314
314- window . history . replaceState ( { } , '' , `${ window . location . pathname } ?${ newQs } ` )
315+ if ( newQs ) {
316+ window . history . replaceState ( { } , '' , `${ window . location . pathname } ?${ newQs } ` )
317+ }
315318}
316319
317320function cycleHotbarSlot ( dir : 1 | - 1 ) {
0 commit comments