@ -1,4 +1,4 @@
import api , { getLinks } from '../api'
import api , { getLinks } from '../api' ;
import Immutable from 'immutable' ;
export const ACCOUNT _FETCH _REQUEST = 'ACCOUNT_FETCH_REQUEST' ;
@ -154,8 +154,8 @@ export function expandAccountTimeline(id) {
api ( getState ) . get ( ` /api/v1/accounts/ ${ id } /statuses ` , {
params : {
limit : 10 ,
max _id : lastId
}
max _id : lastId ,
} ,
} ) . then ( response => {
const next = getLinks ( response ) . refs . find ( link => link . rel === 'next' ) ;
dispatch ( expandAccountTimelineSuccess ( id , response . data , next ) ) ;
@ -175,8 +175,8 @@ export function expandAccountMediaTimeline(id) {
params : {
limit : 12 ,
only _media : 'true' ,
max _id : lastId
}
max _id : lastId ,
} ,
} ) . then ( response => {
const next = getLinks ( response ) . refs . find ( link => link . rel === 'next' ) ;
dispatch ( expandAccountMediaTimelineSuccess ( id , response . data , next ) ) ;
@ -189,14 +189,14 @@ export function expandAccountMediaTimeline(id) {
export function fetchAccountRequest ( id ) {
return {
type : ACCOUNT _FETCH _REQUEST ,
id
id ,
} ;
} ;
export function fetchAccountSuccess ( account ) {
return {
type : ACCOUNT _FETCH _SUCCESS ,
account
account ,
} ;
} ;
@ -205,7 +205,7 @@ export function fetchAccountFail(id, error) {
type : ACCOUNT _FETCH _FAIL ,
id ,
error ,
skipAlert : true
skipAlert : true ,
} ;
} ;
@ -230,48 +230,48 @@ export function unfollowAccount(id) {
} ) . catch ( error => {
dispatch ( unfollowAccountFail ( error ) ) ;
} ) ;
}
} ;
} ;
export function followAccountRequest ( id ) {
return {
type : ACCOUNT _FOLLOW _REQUEST ,
id
id ,
} ;
} ;
export function followAccountSuccess ( relationship ) {
return {
type : ACCOUNT _FOLLOW _SUCCESS ,
relationship
relationship ,
} ;
} ;
export function followAccountFail ( error ) {
return {
type : ACCOUNT _FOLLOW _FAIL ,
error
error ,
} ;
} ;
export function unfollowAccountRequest ( id ) {
return {
type : ACCOUNT _UNFOLLOW _REQUEST ,
id
id ,
} ;
} ;
export function unfollowAccountSuccess ( relationship ) {
return {
type : ACCOUNT _UNFOLLOW _SUCCESS ,
relationship
relationship ,
} ;
} ;
export function unfollowAccountFail ( error ) {
return {
type : ACCOUNT _UNFOLLOW _FAIL ,
error
error ,
} ;
} ;
@ -279,7 +279,7 @@ export function fetchAccountTimelineRequest(id, skipLoading) {
return {
type : ACCOUNT _TIMELINE _FETCH _REQUEST ,
id ,
skipLoading
skipLoading ,
} ;
} ;
@ -289,7 +289,7 @@ export function fetchAccountTimelineSuccess(id, statuses, replace, skipLoading)
id ,
statuses ,
replace ,
skipLoading
skipLoading ,
} ;
} ;
@ -299,7 +299,7 @@ export function fetchAccountTimelineFail(id, error, skipLoading) {
id ,
error ,
skipLoading ,
skipAlert : error . response . status === 404
skipAlert : error . response . status === 404 ,
} ;
} ;
@ -307,7 +307,7 @@ export function fetchAccountMediaTimelineRequest(id, skipLoading) {
return {
type : ACCOUNT _MEDIA _TIMELINE _FETCH _REQUEST ,
id ,
skipLoading
skipLoading ,
} ;
} ;
@ -317,7 +317,7 @@ export function fetchAccountMediaTimelineSuccess(id, statuses, replace, skipLoad
id ,
statuses ,
replace ,
skipLoading
skipLoading ,
} ;
} ;
@ -327,14 +327,14 @@ export function fetchAccountMediaTimelineFail(id, error, skipLoading) {
id ,
error ,
skipLoading ,
skipAlert : error . response . status === 404
skipAlert : error . response . status === 404 ,
} ;
} ;
export function expandAccountTimelineRequest ( id ) {
return {
type : ACCOUNT _TIMELINE _EXPAND _REQUEST ,
id
id ,
} ;
} ;
@ -343,7 +343,7 @@ export function expandAccountTimelineSuccess(id, statuses, next) {
type : ACCOUNT _TIMELINE _EXPAND _SUCCESS ,
id ,
statuses ,
next
next ,
} ;
} ;
@ -351,14 +351,14 @@ export function expandAccountTimelineFail(id, error) {
return {
type : ACCOUNT _TIMELINE _EXPAND _FAIL ,
id ,
error
error ,
} ;
} ;
export function expandAccountMediaTimelineRequest ( id ) {
return {
type : ACCOUNT _MEDIA _TIMELINE _EXPAND _REQUEST ,
id
id ,
} ;
} ;
@ -367,7 +367,7 @@ export function expandAccountMediaTimelineSuccess(id, statuses, next) {
type : ACCOUNT _MEDIA _TIMELINE _EXPAND _SUCCESS ,
id ,
statuses ,
next
next ,
} ;
} ;
@ -375,7 +375,7 @@ export function expandAccountMediaTimelineFail(id, error) {
return {
type : ACCOUNT _MEDIA _TIMELINE _EXPAND _FAIL ,
id ,
error
error ,
} ;
} ;
@ -407,7 +407,7 @@ export function unblockAccount(id) {
export function blockAccountRequest ( id ) {
return {
type : ACCOUNT _BLOCK _REQUEST ,
id
id ,
} ;
} ;
@ -415,35 +415,35 @@ export function blockAccountSuccess(relationship, statuses) {
return {
type : ACCOUNT _BLOCK _SUCCESS ,
relationship ,
statuses
statuses ,
} ;
} ;
export function blockAccountFail ( error ) {
return {
type : ACCOUNT _BLOCK _FAIL ,
error
error ,
} ;
} ;
export function unblockAccountRequest ( id ) {
return {
type : ACCOUNT _UNBLOCK _REQUEST ,
id
id ,
} ;
} ;
export function unblockAccountSuccess ( relationship ) {
return {
type : ACCOUNT _UNBLOCK _SUCCESS ,
relationship
relationship ,
} ;
} ;
export function unblockAccountFail ( error ) {
return {
type : ACCOUNT _UNBLOCK _FAIL ,
error
error ,
} ;
} ;
@ -476,7 +476,7 @@ export function unmuteAccount(id) {
export function muteAccountRequest ( id ) {
return {
type : ACCOUNT _MUTE _REQUEST ,
id
id ,
} ;
} ;
@ -484,35 +484,35 @@ export function muteAccountSuccess(relationship, statuses) {
return {
type : ACCOUNT _MUTE _SUCCESS ,
relationship ,
statuses
statuses ,
} ;
} ;
export function muteAccountFail ( error ) {
return {
type : ACCOUNT _MUTE _FAIL ,
error
error ,
} ;
} ;
export function unmuteAccountRequest ( id ) {
return {
type : ACCOUNT _UNMUTE _REQUEST ,
id
id ,
} ;
} ;
export function unmuteAccountSuccess ( relationship ) {
return {
type : ACCOUNT _UNMUTE _SUCCESS ,
relationship
relationship ,
} ;
} ;
export function unmuteAccountFail ( error ) {
return {
type : ACCOUNT _UNMUTE _FAIL ,
error
error ,
} ;
} ;
@ -535,7 +535,7 @@ export function fetchFollowers(id) {
export function fetchFollowersRequest ( id ) {
return {
type : FOLLOWERS _FETCH _REQUEST ,
id
id ,
} ;
} ;
@ -544,7 +544,7 @@ export function fetchFollowersSuccess(id, accounts, next) {
type : FOLLOWERS _FETCH _SUCCESS ,
id ,
accounts ,
next
next ,
} ;
} ;
@ -552,7 +552,7 @@ export function fetchFollowersFail(id, error) {
return {
type : FOLLOWERS _FETCH _FAIL ,
id ,
error
error ,
} ;
} ;
@ -580,7 +580,7 @@ export function expandFollowers(id) {
export function expandFollowersRequest ( id ) {
return {
type : FOLLOWERS _EXPAND _REQUEST ,
id
id ,
} ;
} ;
@ -589,7 +589,7 @@ export function expandFollowersSuccess(id, accounts, next) {
type : FOLLOWERS _EXPAND _SUCCESS ,
id ,
accounts ,
next
next ,
} ;
} ;
@ -597,7 +597,7 @@ export function expandFollowersFail(id, error) {
return {
type : FOLLOWERS _EXPAND _FAIL ,
id ,
error
error ,
} ;
} ;
@ -619,7 +619,7 @@ export function fetchFollowing(id) {
export function fetchFollowingRequest ( id ) {
return {
type : FOLLOWING _FETCH _REQUEST ,
id
id ,
} ;
} ;
@ -628,7 +628,7 @@ export function fetchFollowingSuccess(id, accounts, next) {
type : FOLLOWING _FETCH _SUCCESS ,
id ,
accounts ,
next
next ,
} ;
} ;
@ -636,7 +636,7 @@ export function fetchFollowingFail(id, error) {
return {
type : FOLLOWING _FETCH _FAIL ,
id ,
error
error ,
} ;
} ;
@ -664,7 +664,7 @@ export function expandFollowing(id) {
export function expandFollowingRequest ( id ) {
return {
type : FOLLOWING _EXPAND _REQUEST ,
id
id ,
} ;
} ;
@ -673,7 +673,7 @@ export function expandFollowingSuccess(id, accounts, next) {
type : FOLLOWING _EXPAND _SUCCESS ,
id ,
accounts ,
next
next ,
} ;
} ;
@ -681,7 +681,7 @@ export function expandFollowingFail(id, error) {
return {
type : FOLLOWING _EXPAND _FAIL ,
id ,
error
error ,
} ;
} ;
@ -708,7 +708,7 @@ export function fetchRelationshipsRequest(ids) {
return {
type : RELATIONSHIPS _FETCH _REQUEST ,
ids ,
skipLoading : true
skipLoading : true ,
} ;
} ;
@ -716,7 +716,7 @@ export function fetchRelationshipsSuccess(relationships) {
return {
type : RELATIONSHIPS _FETCH _SUCCESS ,
relationships ,
skipLoading : true
skipLoading : true ,
} ;
} ;
@ -724,7 +724,7 @@ export function fetchRelationshipsFail(error) {
return {
type : RELATIONSHIPS _FETCH _FAIL ,
error ,
skipLoading : true
skipLoading : true ,
} ;
} ;
@ -734,14 +734,14 @@ export function fetchFollowRequests() {
api ( getState ) . get ( '/api/v1/follow_requests' ) . then ( response => {
const next = getLinks ( response ) . refs . find ( link => link . rel === 'next' ) ;
dispatch ( fetchFollowRequestsSuccess ( response . data , next ? next . uri : null ) )
dispatch ( fetchFollowRequestsSuccess ( response . data , next ? next . uri : null ) ) ;
} ) . catch ( error => dispatch ( fetchFollowRequestsFail ( error ) ) ) ;
} ;
} ;
export function fetchFollowRequestsRequest ( ) {
return {
type : FOLLOW _REQUESTS _FETCH _REQUEST
type : FOLLOW _REQUESTS _FETCH _REQUEST ,
} ;
} ;
@ -749,14 +749,14 @@ export function fetchFollowRequestsSuccess(accounts, next) {
return {
type : FOLLOW _REQUESTS _FETCH _SUCCESS ,
accounts ,
next
next ,
} ;
} ;
export function fetchFollowRequestsFail ( error ) {
return {
type : FOLLOW _REQUESTS _FETCH _FAIL ,
error
error ,
} ;
} ;
@ -772,14 +772,14 @@ export function expandFollowRequests() {
api ( getState ) . get ( url ) . then ( response => {
const next = getLinks ( response ) . refs . find ( link => link . rel === 'next' ) ;
dispatch ( expandFollowRequestsSuccess ( response . data , next ? next . uri : null ) )
dispatch ( expandFollowRequestsSuccess ( response . data , next ? next . uri : null ) ) ;
} ) . catch ( error => dispatch ( expandFollowRequestsFail ( error ) ) ) ;
} ;
} ;
export function expandFollowRequestsRequest ( ) {
return {
type : FOLLOW _REQUESTS _EXPAND _REQUEST
type : FOLLOW _REQUESTS _EXPAND _REQUEST ,
} ;
} ;
@ -787,14 +787,14 @@ export function expandFollowRequestsSuccess(accounts, next) {
return {
type : FOLLOW _REQUESTS _EXPAND _SUCCESS ,
accounts ,
next
next ,
} ;
} ;
export function expandFollowRequestsFail ( error ) {
return {
type : FOLLOW _REQUESTS _EXPAND _FAIL ,
error
error ,
} ;
} ;
@ -812,14 +812,14 @@ export function authorizeFollowRequest(id) {
export function authorizeFollowRequestRequest ( id ) {
return {
type : FOLLOW _REQUEST _AUTHORIZE _REQUEST ,
id
id ,
} ;
} ;
export function authorizeFollowRequestSuccess ( id ) {
return {
type : FOLLOW _REQUEST _AUTHORIZE _SUCCESS ,
id
id ,
} ;
} ;
@ -827,7 +827,7 @@ export function authorizeFollowRequestFail(id, error) {
return {
type : FOLLOW _REQUEST _AUTHORIZE _FAIL ,
id ,
error
error ,
} ;
} ;
@ -846,14 +846,14 @@ export function rejectFollowRequest(id) {
export function rejectFollowRequestRequest ( id ) {
return {
type : FOLLOW _REQUEST _REJECT _REQUEST ,
id
id ,
} ;
} ;
export function rejectFollowRequestSuccess ( id ) {
return {
type : FOLLOW _REQUEST _REJECT _SUCCESS ,
id
id ,
} ;
} ;
@ -861,6 +861,6 @@ export function rejectFollowRequestFail(id, error) {
return {
type : FOLLOW _REQUEST _REJECT _FAIL ,
id ,
error
error ,
} ;
} ;