Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Move simpleInit to volatile
Browse files Browse the repository at this point in the history
This allows to check FF indirectly in other apps
  • Loading branch information
hlomzik committed Feb 1, 2024
1 parent 2f6d865 commit d2ee3c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ export default types
initialized: false,
hydrated: false,
suggestionsRequest: null,
// @todo should be removed along with the FF; it's used to detect FF in other parts
simpleInit: isFF(FF_SIMPLE_INIT),
}))
.views(self => ({
get events() {
Expand Down Expand Up @@ -676,7 +678,6 @@ export default types
*/
function initializeStore({ annotations = [], completions = [], predictions = [], annotationHistory }) {
const as = self.annotationStore;
const simpleInit = isFF(FF_SIMPLE_INIT);

// some hacks to properly clear react and mobx structures
as.afterReset?.();
Expand All @@ -690,7 +691,7 @@ export default types

// goal here is to deserialize everything fast and select only first annotation
// no extra processes during eserialization and further processes triggered during select
if (simpleInit) {
if (self.simpleInit) {
window.STORE_INIT_OK = false;

// add predictions and annotations to the store;
Expand Down

0 comments on commit d2ee3c4

Please sign in to comment.