diff --git a/src/components/dev/apps/ApplicationItem.js b/src/components/dev/apps/ApplicationItem.js index 8f87ac7..76a2061 100644 --- a/src/components/dev/apps/ApplicationItem.js +++ b/src/components/dev/apps/ApplicationItem.js @@ -1,10 +1,10 @@ // @flow +import type { Node } from 'react'; +import type { OauthAppResponse } from 'services/api/oauth'; import React, { Component } from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; - import classNames from 'classnames'; - import { SKIN_LIGHT, COLOR_BLACK, COLOR_RED } from 'components/ui'; import { Input, Button } from 'components/ui/form'; import Collapse from 'components/ui/collapse'; @@ -12,9 +12,6 @@ import Collapse from 'components/ui/collapse'; import styles from './applicationsIndex.scss'; import messages from './ApplicationsIndex.intl.json'; -import type { Node } from 'react'; -import type { OauthAppResponse } from 'services/api/oauth'; - const ACTION_REVOKE_TOKENS = 'revoke-tokens'; const ACTION_RESET_SECRET = 'reset-secret'; const ACTION_DELETE = 'delete'; @@ -41,7 +38,7 @@ export default class ApplicationItem extends Component<{ const { selectedAction, isActionPerforming } = this.state; let actionContent: Node; - // eslint-disable-next-line + switch (selectedAction) { case ACTION_REVOKE_TOKENS: case ACTION_RESET_SECRET: @@ -111,10 +108,11 @@ export default class ApplicationItem extends Component<{ ); break; + default: + actionContent = null; + break; } - // TODO: @SleepWalker: нужно сделать так, чтобы форматирование числа пользователей шло через пробел - return (
{ isFirstScroll = false; + if (targetEl === null) { const id = hash.substr(1); + if (!id) { return; } @@ -119,12 +122,14 @@ export function restoreScroll(targetEl: ?HTMLElement = null) { } const viewPort = document.body; + if (!viewPort) { console.log('Can not find viewPort element'); // eslint-disable-line return; } let y = 0; + if (targetEl) { const { top } = targetEl.getBoundingClientRect(); y = getScrollTop() + top - SCROLL_ANCHOR_OFFSET;