@@ -21,6 +21,7 @@ import { getItemFromBlock } from './chatUtils'
21
21
import { gamepadUiCursorState , moveGamepadCursorByPx } from './react/GamepadUiCursor'
22
22
import { completeTexturePackInstall , resourcePackState } from './resourcePack'
23
23
import { showNotification } from './react/NotificationProvider'
24
+ import { lastConnectOptions } from './react/AppStatusProvider'
24
25
25
26
26
27
export const customKeymaps = proxy ( JSON . parse ( localStorage . keymap || '{}' ) ) as UserOverridesConfig
@@ -303,15 +304,17 @@ function lockUrl () {
303
304
newQs = `loadSave=${ save } `
304
305
} else if ( process . env . NODE_ENV === 'development' ) {
305
306
newQs = `reconnect=1`
306
- } else {
307
+ } else if ( lastConnectOptions . value ?. server ) {
307
308
const qs = new URLSearchParams ( )
308
- const { server, version } = localStorage
309
+ const { server, botVersion } = lastConnectOptions . value
309
310
qs . set ( 'server' , server )
310
- if ( version ) qs . set ( 'version' , version )
311
+ if ( botVersion ) qs . set ( 'version' , botVersion )
311
312
newQs = String ( qs . toString ( ) )
312
313
}
313
314
314
- window . history . replaceState ( { } , '' , `${ window . location . pathname } ?${ newQs } ` )
315
+ if ( newQs ) {
316
+ window . history . replaceState ( { } , '' , `${ window . location . pathname } ?${ newQs } ` )
317
+ }
315
318
}
316
319
317
320
function cycleHotbarSlot ( dir : 1 | - 1 ) {
0 commit comments