Skip to content

Commit ad9e007

Browse files
committed
fix (hmr): Better way to know if the HMR is reloaded. See nativescript-vue#388
1 parent 7f23186 commit ad9e007

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

platform/nativescript/runtime/components/frame.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { setFrame, getFrame, deleteFrame } from '../../util/frame'
2-
import { isHMRChecking } from '../../util/hmr'
2+
import { isHMRChecking, resetHMRChecking } from '../../util/hmr'
33
import { isAndroid, isIOS } from 'tns-core-modules/platform'
44
import { ios as iosUtils } from 'tns-core-modules/utils/utils'
55

@@ -161,6 +161,7 @@ export default {
161161
} else {
162162
// TODO: Implement for Android
163163
}
164+
resetHMRChecking()
164165
},
165166

166167
navigate(entry, back = false) {

platform/nativescript/util/hmr.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ if (module.hot) {
1212
module.hot.addStatusHandler(status => {
1313
if (status === 'check') {
1414
hmrChecking = true
15-
// TODO: Improve the logic here
16-
setTimeout(() => {
17-
hmrChecking = false
18-
}, 2000)
1915
}
2016
})
2117
}

0 commit comments

Comments
 (0)