diff options
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/api/api.service.js | 11 | ||||
| -rw-r--r-- | src/services/backend_interactor_service/backend_interactor_service.js | 5 | ||||
| -rw-r--r-- | src/services/notification_utils/notification_utils.js | 6 |
3 files changed, 4 insertions, 18 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index b7a602b8..75a001a4 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -1,7 +1,5 @@ /* eslint-env browser */ const LOGIN_URL = '/api/account/verify_credentials.json' -const ALL_FOLLOWING_URL = '/api/qvitter/allfollowing' -const MENTIONS_URL = '/api/statuses/mentions.json' const REGISTRATION_URL = '/api/account/register.json' const BG_UPDATE_URL = '/api/qvitter/update_background_image.json' const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json' @@ -308,13 +306,6 @@ const fetchFollowers = ({id, maxId, sinceId, limit = 20, credentials}) => { .then((data) => data.map(parseUser)) } -const fetchAllFollowing = ({username, credentials}) => { - const url = `${ALL_FOLLOWING_URL}/${username}.json` - return fetch(url, { headers: authHeaders(credentials) }) - .then((data) => data.json()) - .then((data) => data.map(parseUser)) -} - const fetchFollowRequests = ({credentials}) => { const url = FOLLOW_REQUESTS_URL return fetch(url, { headers: authHeaders(credentials) }) @@ -434,7 +425,6 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use const timelineUrls = { public: MASTODON_PUBLIC_TIMELINE, friends: MASTODON_USER_HOME_TIMELINE_URL, - mentions: MENTIONS_URL, dms: MASTODON_DIRECT_MESSAGES_TIMELINE_URL, notifications: MASTODON_USER_NOTIFICATIONS_URL, 'publicAndExternal': MASTODON_PUBLIC_TIMELINE, @@ -726,7 +716,6 @@ const apiService = { postStatus, deleteStatus, uploadMedia, - fetchAllFollowing, fetchMutes, muteUser, unmuteUser, diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js index c2b93de4..5d7ae62e 100644 --- a/src/services/backend_interactor_service/backend_interactor_service.js +++ b/src/services/backend_interactor_service/backend_interactor_service.js @@ -23,10 +23,6 @@ const backendInteractorService = (credentials) => { return apiService.fetchFollowers({id, maxId, sinceId, limit, credentials}) } - const fetchAllFollowing = ({username}) => { - return apiService.fetchAllFollowing({username, credentials}) - } - const fetchUser = ({id}) => { return apiService.fetchUser({id, credentials}) } @@ -134,7 +130,6 @@ const backendInteractorService = (credentials) => { unblockUser, fetchUser, fetchUserRelationship, - fetchAllFollowing, verifyCredentials: apiService.verifyCredentials, startFetchingTimeline, startFetchingNotifications, diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js index 8afd114e..f9cbbade 100644 --- a/src/services/notification_utils/notification_utils.js +++ b/src/services/notification_utils/notification_utils.js @@ -25,11 +25,13 @@ const sortById = (a, b) => { } } -export const visibleNotificationsFromStore = store => { +export const visibleNotificationsFromStore = (store, types) => { // map is just to clone the array since sort mutates it and it causes some issues let sortedNotifications = notificationsFromStore(store).map(_ => _).sort(sortById) sortedNotifications = sortBy(sortedNotifications, 'seen') - return sortedNotifications.filter((notification) => visibleTypes(store).includes(notification.type)) + return sortedNotifications.filter( + (notification) => (types || visibleTypes(store)).includes(notification.type) + ) } export const unseenNotificationsFromStore = store => |
