react-native-onyx 2.0.97 → 2.0.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/useOnyx.js +3 -2
- package/package.json +1 -1
package/dist/useOnyx.js
CHANGED
|
@@ -193,8 +193,9 @@ function useOnyx(key, options, dependencies = []) {
|
|
|
193
193
|
const newStatus = newFetchStatus !== null && newFetchStatus !== void 0 ? newFetchStatus : 'loaded';
|
|
194
194
|
resultRef.current = [(_c = previousValueRef.current) !== null && _c !== void 0 ? _c : undefined, { status: newStatus }];
|
|
195
195
|
// If `canBeMissing` is set to `false` and the Onyx value of that key is not defined,
|
|
196
|
-
// we log an alert so it can be acknowledged by the consumer.
|
|
197
|
-
if
|
|
196
|
+
// we log an alert so it can be acknowledged by the consumer. Additionally, we won't log alerts
|
|
197
|
+
// if there's a `Onyx.clear()` task in progress.
|
|
198
|
+
if ((options === null || options === void 0 ? void 0 : options.canBeMissing) === false && newStatus === 'loaded' && !isOnyxValueDefined && !OnyxCache_1.default.hasPendingTask(OnyxCache_1.TASK.CLEAR)) {
|
|
198
199
|
Logger.logAlert(`useOnyx returned no data for key with canBeMissing set to false.`, { key, showAlert: true });
|
|
199
200
|
}
|
|
200
201
|
}
|