提交 70964ca6 编写于 作者: Y YanTao 提交者: Guillaume Chau

fix: browser env mutation.handlers is undefined (#892)

* Fix browser env mutation.handlers is undefined

In the latest Firefox and Google browsers, state data tree will not load for error:[mutation.handlers is undefined], because mutation handler actually passes is null (store. _mutations is empty) while pushing the handlers value as an element to the base mutations array, just add robust check.

* Fix CI lint space problem
上级 7ffe51a8
......@@ -146,7 +146,10 @@ export function initVuexBackend (hook, bridge) {
// Replay mutations
for (let i = snapshot.index + 1; i <= index; i++) {
const mutation = mutations[i]
mutation.handlers.forEach(handler => handler(mutation.payload))
if (mutation.handlers) {
mutation.handlers.forEach(handler => handler(mutation.payload))
}
if (i !== index && i % SharedData.cacheVuexSnapshotsEvery === 0) {
takeSnapshot(i, state)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册