Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix lint

Chocobozzz38768a367bf4
diff --git a/server/initializers/migrations/0175-actor-follow-counts.ts b/server/initializers/migrations/0175-actor-follow-counts.ts
index 06ef77b49a..4fb5241815 100644
--- a/server/initializers/migrations/0175-actor-follow-counts.ts
+++ b/server/initializers/migrations/0175-actor-follow-counts.ts
@@ -1,5 +1,4 @@
import * as Sequelize from 'sequelize'
-import { ACTOR_FOLLOW_SCORE } from '../index'
async function up (utils: {
transaction: Sequelize.Transaction,
diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts
index 435d22db5f..ced4815470 100644
--- a/server/models/activitypub/actor-follow.ts
+++ b/server/models/activitypub/actor-follow.ts
@@ -2,9 +2,8 @@ import * as Bluebird from 'bluebird'
import { values } from 'lodash'
import * as Sequelize from 'sequelize'
import {
- AfterCreate, AfterDestroy, AfterUpdate,
- AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, IsInt, Max, Model, Table,
- UpdatedAt
+ AfterCreate, AfterDestroy, AfterUpdate, AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, IsInt, Max, Model,
+ Table, UpdatedAt
} from 'sequelize-typescript'
import { FollowState } from '../../../shared/models/actors'
import { AccountFollow } from '../../../shared/models/actors/follow.model'
@@ -83,7 +82,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
@AfterCreate
@AfterUpdate
static incrementFollowerAndFollowingCount (instance: ActorFollowModel) {
- if (instance.state !== 'accepted') return
+ if (instance.state !== 'accepted') return undefined
return Promise.all([
ActorModel.incrementFollows(instance.actorId, 'followingCount', 1),
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts
index 27cf949854..d16e98bc12 100644
--- a/server/tests/api/server/follows.ts
+++ b/server/tests/api/server/follows.ts
@@ -117,7 +117,7 @@ describe('Test follows', function () {
expect(follows.length).to.equal(0)
})
- it('Should have the correct following counts', async function () {
+ it('Should have the correct follows counts', async function () {
await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 2)
await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0)
await expectAccountFollows(servers[0].url, 'peertube@localhost:9003', 1, 0)
@@ -158,7 +158,7 @@ describe('Test follows', function () {
expect(follows.length).to.equal(0)
})
- it('Should have the correct following counts 2', async function () {
+ it('Should have the correct follows counts 2', async function () {
await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 1)
await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0)
@@ -248,7 +248,7 @@ describe('Test follows', function () {
await wait(7000)
})
- it('Should have the correct following counts 2', async function () {
+ it('Should have the correct follows counts 3', async function () {
await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 2)
await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0)
await expectAccountFollows(servers[0].url, 'peertube@localhost:9003', 1, 0)