Skip to content

Commit

Permalink
fix drn hot relaunch route error
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyuki committed Jan 14, 2025
1 parent 501107d commit e2b5cdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/platform/createApp.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default function createApp (options) {
}

global.__mpxAppLaunched = false
global.__mpxAppHotLaunched = false
global.__mpxOptionsMap[currentInject.moduleId] = memo((props) => {
const firstRef = useRef(true)
const initialRouteRef = useRef({
Expand All @@ -96,6 +95,8 @@ export default function createApp (options) {
if (firstRef.current) {
// 热启动情况下,app会被销毁重建,将__mpxAppHotLaunched重置保障路由等初始化逻辑正确执行
global.__mpxAppHotLaunched = false
// 热启动情况下重置__mpxPagesMap避免页面销毁函数未及时执行时错误地引用到之前的navigation
global.__mpxPagesMap = {}
firstRef.current = false
}
if (!global.__mpxAppHotLaunched) {
Expand All @@ -112,7 +113,8 @@ export default function createApp (options) {
query: current.params,
scene: 0,
shareTicket: '',
referrerInfo: {}
referrerInfo: {},
isLaunch: true
}
global.__mpxEnterOptions = options
if (!global.__mpxAppLaunched) {
Expand Down

0 comments on commit e2b5cdb

Please sign in to comment.