Skip to content

Commit 1d580a4

Browse files
author
Guillaume Chau
committed
Fix #97
1 parent 47e0623 commit 1d580a4

File tree

5 files changed

+35
-13
lines changed

5 files changed

+35
-13
lines changed

dist/vue-apollo.esm.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,11 +2829,18 @@ var SmartQuery = function (_SmartApollo) {
28292829
}, {
28302830
key: 'fetchMore',
28312831
value: function fetchMore() {
2832+
var _this4 = this;
2833+
28322834
if (this.observer) {
28332835
var _observer;
28342836

28352837
this.maySetLoading(true);
2836-
return (_observer = this.observer).fetchMore.apply(_observer, arguments);
2838+
return (_observer = this.observer).fetchMore.apply(_observer, arguments).then(function (result) {
2839+
if (!result.loading) {
2840+
_this4.loadingDone();
2841+
}
2842+
return result;
2843+
});
28372844
}
28382845
}
28392846
}, {
@@ -2850,14 +2857,15 @@ var SmartQuery = function (_SmartApollo) {
28502857
}, {
28512858
key: 'refetch',
28522859
value: function refetch(variables) {
2853-
var _this4 = this;
2860+
var _this5 = this;
28542861

28552862
variables && (this.options.variables = variables);
28562863
if (this.observer) {
28572864
var result = this.observer.refetch(variables).then(function (result) {
28582865
if (!result.loading) {
2859-
_this4.loadingDone();
2866+
_this5.loadingDone();
28602867
}
2868+
return result;
28612869
});
28622870
this.maySetLoading();
28632871
return result;
@@ -2911,15 +2919,15 @@ var SmartSubscription = function (_SmartApollo2) {
29112919
function SmartSubscription() {
29122920
var _ref;
29132921

2914-
var _temp, _this5, _ret;
2922+
var _temp, _this6, _ret;
29152923

29162924
classCallCheck(this, SmartSubscription);
29172925

29182926
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
29192927
args[_key] = arguments[_key];
29202928
}
29212929

2922-
return _ret = (_temp = (_this5 = possibleConstructorReturn(this, (_ref = SmartSubscription.__proto__ || Object.getPrototypeOf(SmartSubscription)).call.apply(_ref, [this].concat(args))), _this5), _this5.type = 'subscription', _this5.vueApolloSpecialKeys = ['variables', 'result', 'error', 'throttle', 'debounce', 'linkedQuery'], _temp), possibleConstructorReturn(_this5, _ret);
2930+
return _ret = (_temp = (_this6 = possibleConstructorReturn(this, (_ref = SmartSubscription.__proto__ || Object.getPrototypeOf(SmartSubscription)).call.apply(_ref, [this].concat(args))), _this6), _this6.type = 'subscription', _this6.vueApolloSpecialKeys = ['variables', 'result', 'error', 'throttle', 'debounce', 'linkedQuery'], _temp), possibleConstructorReturn(_this6, _ret);
29232931
}
29242932

29252933
createClass(SmartSubscription, [{

dist/vue-apollo.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-apollo.umd.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,11 +2835,18 @@ var SmartQuery = function (_SmartApollo) {
28352835
}, {
28362836
key: 'fetchMore',
28372837
value: function fetchMore() {
2838+
var _this4 = this;
2839+
28382840
if (this.observer) {
28392841
var _observer;
28402842

28412843
this.maySetLoading(true);
2842-
return (_observer = this.observer).fetchMore.apply(_observer, arguments);
2844+
return (_observer = this.observer).fetchMore.apply(_observer, arguments).then(function (result) {
2845+
if (!result.loading) {
2846+
_this4.loadingDone();
2847+
}
2848+
return result;
2849+
});
28432850
}
28442851
}
28452852
}, {
@@ -2856,14 +2863,15 @@ var SmartQuery = function (_SmartApollo) {
28562863
}, {
28572864
key: 'refetch',
28582865
value: function refetch(variables) {
2859-
var _this4 = this;
2866+
var _this5 = this;
28602867

28612868
variables && (this.options.variables = variables);
28622869
if (this.observer) {
28632870
var result = this.observer.refetch(variables).then(function (result) {
28642871
if (!result.loading) {
2865-
_this4.loadingDone();
2872+
_this5.loadingDone();
28662873
}
2874+
return result;
28672875
});
28682876
this.maySetLoading();
28692877
return result;
@@ -2917,15 +2925,15 @@ var SmartSubscription = function (_SmartApollo2) {
29172925
function SmartSubscription() {
29182926
var _ref;
29192927

2920-
var _temp, _this5, _ret;
2928+
var _temp, _this6, _ret;
29212929

29222930
classCallCheck(this, SmartSubscription);
29232931

29242932
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
29252933
args[_key] = arguments[_key];
29262934
}
29272935

2928-
return _ret = (_temp = (_this5 = possibleConstructorReturn(this, (_ref = SmartSubscription.__proto__ || Object.getPrototypeOf(SmartSubscription)).call.apply(_ref, [this].concat(args))), _this5), _this5.type = 'subscription', _this5.vueApolloSpecialKeys = ['variables', 'result', 'error', 'throttle', 'debounce', 'linkedQuery'], _temp), possibleConstructorReturn(_this5, _ret);
2936+
return _ret = (_temp = (_this6 = possibleConstructorReturn(this, (_ref = SmartSubscription.__proto__ || Object.getPrototypeOf(SmartSubscription)).call.apply(_ref, [this].concat(args))), _this6), _this6.type = 'subscription', _this6.vueApolloSpecialKeys = ['variables', 'result', 'error', 'throttle', 'debounce', 'linkedQuery'], _temp), possibleConstructorReturn(_this6, _ret);
29292937
}
29302938

29312939
createClass(SmartSubscription, [{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-apollo",
3-
"version": "2.1.0-beta.22",
3+
"version": "2.1.0-beta.23",
44
"description": "Vue apollo integration",
55
"main": "dist/vue-apollo.umd.js",
66
"module": "dist/vue-apollo.esm.js",

src/smart-apollo.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ export class SmartQuery extends SmartApollo {
253253
fetchMore (...args) {
254254
if (this.observer) {
255255
this.maySetLoading(true)
256-
return this.observer.fetchMore(...args)
256+
return this.observer.fetchMore(...args).then(result => {
257+
if (!result.loading) {
258+
this.loadingDone()
259+
}
260+
return result
261+
})
257262
}
258263
}
259264

@@ -272,6 +277,7 @@ export class SmartQuery extends SmartApollo {
272277
if (!result.loading) {
273278
this.loadingDone()
274279
}
280+
return result
275281
})
276282
this.maySetLoading()
277283
return result

0 commit comments

Comments
 (0)