From 8ef3fba80dfa018138aba8bf2a9fddf38b1422bb Mon Sep 17 00:00:00 2001 From: Benjamin Faal Date: Tue, 29 Aug 2017 21:00:58 +0200 Subject: [PATCH] Patches are not applied correctly in react native Very confusing no error or warning or anything, i advise to just overwrite them anyway, or at least throw an error or warning when the patched functions wont be applied --- src/ParsePatches.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ParsePatches.js b/src/ParsePatches.js index c0b3481..260f6be 100644 --- a/src/ParsePatches.js +++ b/src/ParsePatches.js @@ -90,15 +90,9 @@ var pointerMethods = ['equalTo', 'notEqualTo', 'containedIn', 'notContainedIn']; var ParsePatches = { applyPatches: function() { - if (!Parse.Object.prototype.toPlainObject) { - Parse.Object.prototype.toPlainObject = patches.toPlainObject; - } - if (!Parse.Query.prototype.subscribe) { - Parse.Query.prototype.subscribe = patches.subscribe; - } - if (!Parse.Query.prototype.observeOne) { - Parse.Query.prototype.observeOne = patches.observeOne; - } + Parse.Object.prototype.toPlainObject = patches.toPlainObject; + Parse.Query.prototype.subscribe = patches.subscribe; + Parse.Query.prototype.observeOne = patches.observeOne; pointerMethods.forEach(function(method) { var old = Parse.Query.prototype[method]; Parse.Query.prototype[method] = function(attr, value) {