Skip to content

Commit

Permalink
Merge branch 'fix-drn' of https://github.com/didi/mpx into fix-drn
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcuijuan committed Jan 14, 2025
2 parents c90835e + 5679fce commit 6ebf49a
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 @@ -83,7 +83,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 @@ -93,6 +92,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 @@ -109,7 +110,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 6ebf49a

Please sign in to comment.