Skip to content

Commit

Permalink
fix(internal-pages): Disable refresh button for Bookmarks and History…
Browse files Browse the repository at this point in the history
… pages as they are not webview instances
  • Loading branch information
hunterlester authored and joshuef committed Mar 1, 2019
1 parent 355b83c commit d1c21f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/components/AddressBar/ButtonsLHS/ButtonsLHS.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, { Component } from "react";
import logger from "logger";
import { CLASSES } from "@Constants";
import { CLASSES, PROTOCOLS } from '@Constants';
import { Row, Col, Button } from "antd";
import "antd/lib/row/style";
import "antd/lib/col/style";
import "antd/lib/button/style";
import { I18n } from "react-redux-i18n";
import extendComponent from "@Utils/extendComponent";
import { wrapAddressBarButtonsLHS } from "@Extensions/components";
import { parse } from 'url';
import styles from "./buttonsLHS.css";
/**
* Left hand side buttons for the Address Bar
Expand All @@ -23,6 +24,8 @@ class ButtonsLHS extends Component<{}, {}> {
canGoForwards,
canGoBackwards
} = this.props;
const activeTabUrl = activeTab && activeTab.url ? parse( activeTab.url ) : undefined;

return (
<Row
type="flex"
Expand Down Expand Up @@ -57,7 +60,7 @@ class ButtonsLHS extends Component<{}, {}> {
shape="circle"
icon="reload"
aria-label={I18n.t("aria.reload_page")}
disabled={activeTab.isLoading}
disabled={activeTab.isLoading || activeTabUrl && activeTabUrl.protocol ? activeTabUrl.protocol.includes( PROTOCOLS.INTERNAL_PAGES ) : false}
onClick={handleRefresh}
/>
</Col>
Expand Down

0 comments on commit d1c21f2

Please sign in to comment.