Github user millayr commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/864#discussion_r105690327
--- 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 --
why use `return` here? somewhat tough to follow the logic if it's only use
for control flow in this context.
---
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.
---