()
| 58 | |
| 59 | React.useEffect(() => { |
| 60 | const restoreState = async () => { |
| 61 | try { |
| 62 | const savedStateString = await AsyncStorage.getItem(PERSISTENCE_KEY); |
| 63 | const state = JSON.parse(savedStateString || ''); |
| 64 | |
| 65 | setInitialState(state); |
| 66 | } catch (e) { |
| 67 | // ignore error |
| 68 | } finally { |
| 69 | setIsReady(true); |
| 70 | } |
| 71 | }; |
| 72 | |
| 73 | if (!isReady) { |
| 74 | restoreState(); |
no test coverage detected
searching dependent graphs…