Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/864#discussion_r105855225
--- Diff: app/addons/replication/api.js ---
@@ -16,6 +16,30 @@ import app from '../../app';
import FauxtonAPI from '../../core/api';
import base64 from 'base-64';
import _ from 'lodash';
+import 'whatwg-fetch';
+
+let newApiPromise = null;
+export const supportNewApi = (forceCheck) => {
+ if (!newApiPromise || forceCheck) {
+ newApiPromise = new FauxtonAPI.Promise((resolve) => {
+ fetch('/_scheduler/jobs', {
+ credentials: 'include',
+ headers: {
+ 'Accept': 'application/json; charset=utf-8',
+ }
+ })
+ .then(resp => {
+ if (resp.status > 202) {
+ return resolve(false);
--- End diff --
if we don't use the return here, then it once its outside the if statement
it will then try and resolve the promise again with `true`. I could put the
return after the resolve. It doesn't really matter
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---