import { ObservableEventStore , ObservableNetworkStore , ObservableNotificationStore , ObservableRemoteConfigStore , ObservableRootStore , ObservableSetStore , ObservableSyncStore , ObservableThemeStore , ObservableUserStore , } from '@ulangi/ulangi-observable' ; import { observable } from 'mobx' ; import { config } from '../constants/config' ; export function resetState ( currentState ) { const userStore = new ObservableUserStore ( null ) ; const setStore = new ObservableSetStore ( null , null , null ) ; const networkStore = new ObservableNetworkStore ( currentState . networkStore . isConnected ) ; const syncStore = new ObservableSyncStore ( 'NOT_SYNCING' ) ; const remoteConfigStore = new ObservableRemoteConfigStore ( null ) ; const notificationStore = new ObservableNotificationStore ( null ) ; const themeStore = new ObservableThemeStore ( userStore , config . user . defaultThemeSettings , currentState . themeStore . systemMode ) ; const eventStore = new ObservableEventStore ( observable . array ( [ ] ) ) ; currentState . reset ( new ObservableRootStore ( userStore , setStore , networkStore , syncStore , remoteConfigStore , notificationStore , themeStore , eventStore ) ) ; }