Skip to content

Commit

Permalink
Fix dev errors in hot reload (HMR)
Browse files Browse the repository at this point in the history
  • Loading branch information
phil294 committed Nov 24, 2024
1 parent c2981fb commit 85a72ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/src/state/store.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ref, computed, shallowRef } from 'vue'
import { ref, computed, shallowRef, nextTick } from 'vue'
import { parse } from '../utils/log-parser.js'
import { git, exchange_message, add_push_listener, show_information_message } from '../bridge.js'
export { update_commit_stats } from './commit-stats'
Expand All @@ -25,7 +25,8 @@ export let stateful_computed = (/** @type {string} */ key, /** @type {T} */ defa
/** @type {Vue.WritableComputedRef<T>|undefined} */
let ret = _stateful_computeds[key]
if (ret) {
on_load()
nextTick()
.then(on_load)
return ret
}
// shallow because type error https://github.com/vuejs/composition-api/issues/483
Expand All @@ -45,6 +46,7 @@ export let stateful_computed = (/** @type {string} */ key, /** @type {T} */ defa
internal.value = stored // to skip the unnecessary roundtrip to backend
ret.value = stored
}
await nextTick()
on_load?.()
})()
return ret
Expand Down

0 comments on commit 85a72ec

Please sign in to comment.