diff --git a/app/javascript/core/public.js b/app/javascript/core/public.js
index 5c7a51f44..4fdda5c3e 100644
--- a/app/javascript/core/public.js
+++ b/app/javascript/core/public.js
@@ -1,10 +1,8 @@
// This file will be loaded on public pages, regardless of theme.
import 'packs/public-path';
-import ready from '../mastodon/ready';
const { delegate } = require('@rails/ujs');
-const { length } = require('stringz');
const getProfileAvatarAnimationHandler = (swapTo) => {
//animate avatar gifs on the profile page when moused over
diff --git a/app/javascript/flavours/glitch/actions/accounts.js b/app/javascript/flavours/glitch/actions/accounts.js
index 6b5b2ade5..92442ff59 100644
--- a/app/javascript/flavours/glitch/actions/accounts.js
+++ b/app/javascript/flavours/glitch/actions/accounts.js
@@ -1,5 +1,5 @@
import api, { getLinks } from '../api';
-import { importAccount, importFetchedAccount, importFetchedAccounts } from './importer';
+import { importFetchedAccount, importFetchedAccounts } from './importer';
export const ACCOUNT_FETCH_REQUEST = 'ACCOUNT_FETCH_REQUEST';
export const ACCOUNT_FETCH_SUCCESS = 'ACCOUNT_FETCH_SUCCESS';
diff --git a/app/javascript/flavours/glitch/actions/timelines.js b/app/javascript/flavours/glitch/actions/timelines.js
index eb817daf9..bde96c504 100644
--- a/app/javascript/flavours/glitch/actions/timelines.js
+++ b/app/javascript/flavours/glitch/actions/timelines.js
@@ -3,7 +3,7 @@ import { submitMarkers } from './markers';
import api, { getLinks } from 'flavours/glitch/api';
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
import compareId from 'flavours/glitch/compare_id';
-import { me, usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state';
+import { usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state';
import { toServerSideType } from 'flavours/glitch/utils/filters';
export const TIMELINE_UPDATE = 'TIMELINE_UPDATE';
@@ -121,7 +121,6 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) {
api(getState).get(path, { params }).then(response => {
const next = getLinks(response).refs.find(link => link.rel === 'next');
-
dispatch(importFetchedStatuses(response.data));
dispatch(expandTimelineSuccess(timelineId, response.data, next ? next.uri : null, response.status === 206, isLoadingRecent, isLoadingMore, isLoadingRecent && preferPendingItems));
@@ -163,10 +162,10 @@ export const expandListTimeline = (id, { maxId } = {}, done = noOp) =
export const expandHashtagTimeline = (hashtag, { maxId, tags, local } = {}, done = noOp) => {
return expandTimeline(`hashtag:${hashtag}${local ? ':local' : ''}`, `/api/v1/timelines/tag/${hashtag}`, {
max_id: maxId,
- any: parseTags(tags, 'any'),
- all: parseTags(tags, 'all'),
- none: parseTags(tags, 'none'),
- local: local,
+ any: parseTags(tags, 'any'),
+ all: parseTags(tags, 'all'),
+ none: parseTags(tags, 'none'),
+ local: local,
}, done);
};
diff --git a/app/javascript/flavours/glitch/components/avatar_composite.jsx b/app/javascript/flavours/glitch/components/avatar_composite.jsx
index c0ce7761d..98ea9d272 100644
--- a/app/javascript/flavours/glitch/components/avatar_composite.jsx
+++ b/app/javascript/flavours/glitch/components/avatar_composite.jsx
@@ -9,6 +9,7 @@ export default class AvatarComposite extends React.PureComponent {
accounts: ImmutablePropTypes.list.isRequired,
animate: PropTypes.bool,
size: PropTypes.number.isRequired,
+ onAccountClick: PropTypes.func.isRequired,
};
static defaultProps = {
diff --git a/app/javascript/flavours/glitch/components/display_name.jsx b/app/javascript/flavours/glitch/components/display_name.jsx
index 19f63ec60..f58a8df82 100644
--- a/app/javascript/flavours/glitch/components/display_name.jsx
+++ b/app/javascript/flavours/glitch/components/display_name.jsx
@@ -14,6 +14,7 @@ export default class DisplayName extends React.PureComponent {
localDomain: PropTypes.string,
others: ImmutablePropTypes.list,
handleClick: PropTypes.func,
+ onAccountClick: PropTypes.func,
};
handleMouseEnter = ({ currentTarget }) => {
@@ -61,6 +62,7 @@ export default class DisplayName extends React.PureComponent {
if (others && others.size > 0) {
displayName = others.take(2).map(a => (
onAccountClick(a.get('acct'), e)}
diff --git a/app/javascript/flavours/glitch/components/icon_button.jsx b/app/javascript/flavours/glitch/components/icon_button.jsx
index 10d7926be..93640dd0f 100644
--- a/app/javascript/flavours/glitch/components/icon_button.jsx
+++ b/app/javascript/flavours/glitch/components/icon_button.jsx
@@ -1,6 +1,4 @@
import React from 'react';
-import Motion from '../features/ui/util/optional_motion';
-import spring from 'react-motion/lib/spring';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Icon from 'flavours/glitch/components/icon';
@@ -25,7 +23,7 @@ export default class IconButton extends React.PureComponent {
inverted: PropTypes.bool,
animate: PropTypes.bool,
overlay: PropTypes.bool,
- tabIndex: PropTypes.string,
+ tabIndex: PropTypes.number,
label: PropTypes.string,
counter: PropTypes.number,
obfuscateCount: PropTypes.bool,
@@ -39,7 +37,7 @@ export default class IconButton extends React.PureComponent {
disabled: false,
animate: false,
overlay: false,
- tabIndex: '0',
+ tabIndex: 0,
ariaHidden: false,
};
@@ -156,6 +154,7 @@ export default class IconButton extends React.PureComponent {
return (
diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx b/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx
index 9b55fe4e9..436f64b5d 100644
--- a/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx
+++ b/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx
@@ -2,22 +2,17 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
-import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+import { FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { HotKeys } from 'react-hotkeys';
import classNames from 'classnames';
// Our imports.
import Permalink from 'flavours/glitch/components/permalink';
-import AccountContainer from 'flavours/glitch/containers/account_container';
import NotificationOverlayContainer from '../containers/overlay_container';
import Icon from 'flavours/glitch/components/icon';
import Report from './report';
-const messages = defineMessages({
- adminReport: { id: 'notification.admin.report', defaultMessage: '{name} reported {target}' },
-});
-
export default class AdminReport extends ImmutablePureComponent {
static propTypes = {
@@ -67,7 +62,7 @@ export default class AdminReport extends ImmutablePureComponent {
}
render () {
- const { intl, account, notification, unread, report } = this.props;
+ const { account, notification, unread, report } = this.props;
if (!report) {
return null;
diff --git a/app/javascript/flavours/glitch/features/notifications/containers/follow_request_container.js b/app/javascript/flavours/glitch/features/notifications/containers/follow_request_container.js
index 82357adfb..004d1e173 100644
--- a/app/javascript/flavours/glitch/features/notifications/containers/follow_request_container.js
+++ b/app/javascript/flavours/glitch/features/notifications/containers/follow_request_container.js
@@ -1,5 +1,4 @@
import { connect } from 'react-redux';
-import { makeGetAccount } from 'flavours/glitch/selectors';
import FollowRequest from '../components/follow_request';
import { authorizeFollowRequest, rejectFollowRequest } from 'flavours/glitch/actions/accounts';
diff --git a/app/javascript/flavours/glitch/features/notifications/index.jsx b/app/javascript/flavours/glitch/features/notifications/index.jsx
index 2de073077..b9c9d8203 100644
--- a/app/javascript/flavours/glitch/features/notifications/index.jsx
+++ b/app/javascript/flavours/glitch/features/notifications/index.jsx
@@ -9,9 +9,9 @@ import {
enterNotificationClearingMode,
expandNotifications,
scrollTopNotifications,
+ loadPending,
mountNotifications,
unmountNotifications,
- loadPending,
markNotificationsAsRead,
} from 'flavours/glitch/actions/notifications';
import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';
@@ -79,16 +79,6 @@ const mapDispatchToProps = dispatch => ({
onEnterCleaningMode(yes) {
dispatch(enterNotificationClearingMode(yes));
},
- onMarkAsRead() {
- dispatch(markNotificationsAsRead());
- dispatch(submitMarkers({ immediate: true }));
- },
- onMount() {
- dispatch(mountNotifications());
- },
- onUnmount() {
- dispatch(unmountNotifications());
- },
dispatch,
});
@@ -112,8 +102,6 @@ class Notifications extends React.PureComponent {
localSettings: ImmutablePropTypes.map,
notifCleaningActive: PropTypes.bool,
onEnterCleaningMode: PropTypes.func,
- onMount: PropTypes.func,
- onUnmount: PropTypes.func,
lastReadId: PropTypes.string,
canMarkAsRead: PropTypes.bool,
needsNotificationPermission: PropTypes.bool,
@@ -127,6 +115,18 @@ class Notifications extends React.PureComponent {
animatingNCD: false,
};
+ componentDidMount() {
+ this.props.dispatch(mountNotifications());
+ }
+
+ componentWillUnmount () {
+ this.handleLoadOlder.cancel();
+ this.handleScrollToTop.cancel();
+ this.handleScroll.cancel();
+ // this.props.dispatch(scrollTopNotifications(false));
+ this.props.dispatch(unmountNotifications());
+ }
+
handleLoadGap = (maxId) => {
this.props.dispatch(expandNotifications({ maxId }));
};
@@ -195,20 +195,6 @@ class Notifications extends React.PureComponent {
}
}
- componentDidMount () {
- const { onMount } = this.props;
- if (onMount) {
- onMount();
- }
- }
-
- componentWillUnmount () {
- const { onUnmount } = this.props;
- if (onUnmount) {
- onUnmount();
- }
- }
-
handleTransitionEndNCD = () => {
this.setState({ animatingNCD: false });
};
@@ -219,12 +205,13 @@ class Notifications extends React.PureComponent {
};
handleMarkAsRead = () => {
- this.props.onMarkAsRead();
+ this.props.dispatch(markNotificationsAsRead());
+ this.props.dispatch(submitMarkers({ immediate: true }));
};
render () {
const { intl, notifications, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props;
- const { notifCleaning, notifCleaningActive } = this.props;
+ const { notifCleaningActive } = this.props;
const { animatingNCD } = this.state;
const pinned = !!columnId;
const emptyMessage = ;
diff --git a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/account_container.js b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/account_container.js
index 149d05c32..155afcca1 100644
--- a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/account_container.js
+++ b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/account_container.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import { makeGetAccount } from 'flavours/glitch/selectors';
import { injectIntl } from 'react-intl';
diff --git a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js
index db586ecf7..0ada7b040 100644
--- a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js
+++ b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import {
diff --git a/app/javascript/flavours/glitch/features/video/index.jsx b/app/javascript/flavours/glitch/features/video/index.jsx
index a73320e89..0a9db059e 100644
--- a/app/javascript/flavours/glitch/features/video/index.jsx
+++ b/app/javascript/flavours/glitch/features/video/index.jsx
@@ -554,7 +554,7 @@ class Video extends React.PureComponent {
playerStyle.height = height;
} else if (inline) {
- return ();
+ return ();
}
let preload;