diff options
| author | rinpatch <rinpatch@sdf.org> | 2019-09-16 11:38:37 +0000 |
|---|---|---|
| committer | rinpatch <rinpatch@sdf.org> | 2019-09-16 11:38:37 +0000 |
| commit | 1306fac38f46b5578d46cc6abd6168a3399886b1 (patch) | |
| tree | 9e92df60075bee0285e6b34d8b433cb6065f3b3f /src/services/follow_manipulate/follow_manipulate.js | |
| parent | b33667a74342a9fc91386d12763b5c2f1101868a (diff) | |
| parent | 9b163d281670e0c0a589adce46727284fbcba0ad (diff) | |
Merge branch 'develop' into 'muting-fixes'
# Conflicts:
# src/components/status/status.js
Diffstat (limited to 'src/services/follow_manipulate/follow_manipulate.js')
| -rw-r--r-- | src/services/follow_manipulate/follow_manipulate.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/services/follow_manipulate/follow_manipulate.js b/src/services/follow_manipulate/follow_manipulate.js index 529fdb9b..d82ce593 100644 --- a/src/services/follow_manipulate/follow_manipulate.js +++ b/src/services/follow_manipulate/follow_manipulate.js @@ -9,10 +9,7 @@ const fetchUser = (attempt, user, store) => new Promise((resolve, reject) => { if (!following && !(locked && sent) && attempt <= 3) { // If we BE reports that we still not following that user - retry, // increment attempts by one - return fetchUser(++attempt, user, store) - } else { - // If we run out of attempts, just return whatever status is. - return sent + fetchUser(++attempt, user, store) } }) @@ -23,7 +20,7 @@ export const requestFollow = (user, store) => new Promise((resolve, reject) => { if (updated.following || (user.locked && user.requested)) { // If we get result immediately or the account is locked, just stop. - resolve({ sent: updated.requested }) + resolve() return } @@ -35,8 +32,8 @@ export const requestFollow = (user, store) => new Promise((resolve, reject) => { // Recursive Promise, it will call itself up to 3 times. return fetchUser(1, user, store) - .then((sent) => { - resolve({ sent }) + .then(() => { + resolve() }) }) }) |
