diff --git a/app/soapbox/actions/__tests__/accounts.test.ts b/app/soapbox/actions/__tests__/accounts.test.ts
index b02469527..2ea60bd80 100644
--- a/app/soapbox/actions/__tests__/accounts.test.ts
+++ b/app/soapbox/actions/__tests__/accounts.test.ts
@@ -435,10 +435,14 @@ describe('followAccount()', () => {
skipLoading: true,
},
];
- await store.dispatch(followAccount(id));
- const actions = store.getActions();
- expect(actions).toEqual(expectedActions);
+ try {
+ await store.dispatch(followAccount(id));
+ } catch (e) {
+ const actions = store.getActions();
+ expect(actions).toEqual(expectedActions);
+ expect(e).toEqual(new Error('Network Error'));
+ }
});
});
});
diff --git a/app/soapbox/actions/accounts.js b/app/soapbox/actions/accounts.js
index 5cc0008a4..63314a6b1 100644
--- a/app/soapbox/actions/accounts.js
+++ b/app/soapbox/actions/accounts.js
@@ -240,7 +240,10 @@ export function followAccount(id, options = { reblogs: true }) {
return api(getState)
.post(`/api/v1/accounts/${id}/follow`, options)
.then(response => dispatch(followAccountSuccess(response.data, alreadyFollowing)))
- .catch(error => dispatch(followAccountFail(error, locked)));
+ .catch(error => {
+ dispatch(followAccountFail(error, locked));
+ throw error;
+ });
};
}
diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js
index b76a156a5..d90fd0f39 100644
--- a/app/soapbox/features/account/components/header.js
+++ b/app/soapbox/features/account/components/header.js
@@ -17,6 +17,7 @@ import StillImage from 'soapbox/components/still_image';
import { HStack, IconButton, Menu, MenuButton, MenuItem, MenuList, MenuLink, MenuDivider } from 'soapbox/components/ui';
import SvgIcon from 'soapbox/components/ui/icon/svg-icon';
import ActionButton from 'soapbox/features/ui/components/action-button';
+import SubscriptionButton from 'soapbox/features/ui/components/subscription-button';
import {
isLocal,
isRemote,
@@ -250,22 +251,6 @@ class Header extends ImmutablePureComponent {
});
}
- if (features.accountSubscriptions) {
- if (account.relationship?.subscribing) {
- menu.push({
- text: intl.formatMessage(messages.unsubscribe, { name: account.get('username') }),
- action: this.props.onSubscriptionToggle,
- icon: require('@tabler/icons/icons/bell.svg'),
- });
- } else {
- menu.push({
- text: intl.formatMessage(messages.subscribe, { name: account.get('username') }),
- action: this.props.onSubscriptionToggle,
- icon: require('@tabler/icons/icons/bell-off.svg'),
- });
- }
- }
-
if (features.lists) {
menu.push({
text: intl.formatMessage(messages.add_or_remove_from_list),
@@ -476,7 +461,7 @@ class Header extends ImmutablePureComponent {
}
+ title={}
/>,
);
}
@@ -578,11 +563,6 @@ class Header extends ImmutablePureComponent {
const menu = this.makeMenu();
const header = account.get('header', '');
- // NOTE: Removing Subscription element
- // {features.accountSubscriptions &&
- //
- //
}
-
return (
@@ -618,6 +598,8 @@ class Header extends ImmutablePureComponent {
+
+
{me && (