Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global / console cleanup #4809

Merged
merged 8 commits into from
Sep 24, 2021
5 changes: 0 additions & 5 deletions src/common/utils/apiLooper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const apiQuery = {}
const apiQueryTimers = {}
const apiQueryTicks = 10

const apis = {}

const apiQueryTimer = (queryName) => {
if (apiQuery[queryName].length) {
const queryChunk = apiQuery[queryName].shift()
Expand Down Expand Up @@ -155,7 +153,6 @@ const apiLooper = (method, api, endpoint, options) => {
.then((answer) => {
if (options && options.checkStatus instanceof Function) {
if (!options.checkStatus(answer)) {
console.error(`Endpoint ${currentEndpoint.url} - checkStatus failed (may be down). Switch next`)
if (switchNext(api)) {
doRequest()
} else {
Expand Down Expand Up @@ -185,11 +182,9 @@ const apiLooper = (method, api, endpoint, options) => {
}
}
if (ignoreErrors) {
console.log('Ignore error ^')
resolve(answer)
return
}
console.error(`Endpoint ${currentEndpoint.url} may be offline. Switch next`)
if (switchNext(apiName)) {
doRequest()
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/front/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<title><%= htmlWebpackPlugin.options.title %></title>

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:image:type" content="image/svg+xml" />
<meta
property="og:image"
content="https://screenshots.wpmix.net/chrome_2019-03-28_18-55-506746c4c5-44e6-4bb5-89cb-52ce8fabcedf.png"
content="https://wiki.swaponline.io/assets/swaponline_io.svg"
/>
<meta http-equiv="refresh" content="3600">
<link
Expand Down
1 change: 0 additions & 1 deletion src/front/shared/components/BalanceForm/BalanceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function BalanceForm({
multisigPendingCount = 10,
}) {
const [selectedCurrency, setActiveCurrency] = useState(activeCurrency)
const isDark = document.body.dataset.scheme === 'dark'
const isWidgetBuild = config && config.isWidget

useEffect(() => {
Expand Down
3 changes: 0 additions & 3 deletions src/front/shared/components/BalanceForm/images/dollar2.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default class UserTooltip extends Component<any, any> {

return (
mePeer === ownerPeer &&
request.map(({ participant: { peer }, reputation }, index) => (
<div styleName="userTooltip" key={index}>
request.map(({ participant: { peer }, reputation }) => (
<div styleName="userTooltip" key={id}>
<div>
<div styleName="title">
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import DescrSection from './components/DescrSection/DescrSection'
import BalanceSection from './components/BalanceSection/BalanceSection'
import BannersSection from './components/BannersSection/BannersSection'

function ContentLoader({ empty, inner, rideSideContent, leftSideContent, banners, nonHeader }) {
function ContentLoader(props) {
const { empty, inner, rideSideContent, leftSideContent, banners, nonHeader } = props

return (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export default class ModalConductor extends Component<any, any> {
return areModalsExist && (
<div styleName={`${!dashboardView ? 'modalConductor' : 'modalDashboardConductor'}`}>
{
modalNames.map((key) => {
modalNames.map((key, index) => {
const { name, data = {}, zIndex } = modals[key]

if (zIndex === highestZIndex) {
return React.createElement(Modals[name], {
key: name,
key: index,
name,
data,
history,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@
color: var(--color);

td.header {
@include ff-semibold;
text-align: left;
font-weight: bold;
font-size: 1.1em;
}

td.data {
text-align: justify;
td.responsiveBlock {
@include ff-mono;
}
}

Expand Down
25 changes: 10 additions & 15 deletions src/front/shared/components/modals/InfoInvoice/InfoInvoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ import ShareButton from 'components/controls/ShareButton/ShareButton'
import Button from 'components/controls/Button/Button'

import { isMobile } from "react-device-detect"

import imgReady from './images/ready.svg'
import imgPending from './images/pending.svg'
import imgCanceled from './images/cancel.svg'

import { regularIcons } from 'images'

const langPrefix = 'InvoiceInfoModal'
const langLabels = defineMessages({
Expand All @@ -44,7 +40,7 @@ const langLabels = defineMessages({
},
invoiceComment: {
id: `${langPrefix}_Comment`,
defaultMessage: `Комментарий`,
defaultMessage: `Comment`,
},
fromAddress: {
id: `${langPrefix}_FromAddress`,
Expand Down Expand Up @@ -292,15 +288,15 @@ class InfoInvoice extends React.Component<any, any> {
switch (status) {
case 'ready':
infoIconTitle = intl.formatMessage(langLabels.infoStatusReady)
infoIconUrl = imgReady
infoIconUrl = regularIcons.OK
break;
case 'cancelled':
infoIconTitle = intl.formatMessage(langLabels.infoStatusDeclimed)
infoIconUrl = imgCanceled
infoIconUrl = regularIcons.CANCELLED
break;
default:
infoIconTitle = intl.formatMessage(langLabels.infoStatusPending)
infoIconUrl = imgPending
infoIconUrl = regularIcons.PENDING
}

return (
Expand Down Expand Up @@ -384,26 +380,25 @@ class InfoInvoice extends React.Component<any, any> {
<tr>
<td styleName="responsiveBlock">{invoiceData.contact}</td>
</tr>

<tr>
<td styleName="header" colSpan={2}>
<FormattedMessage { ...langLabels.fromAddress } />
</td>
</tr>
<tr>
<td styleName="responsiveBlock" colSpan={2}>
<span>{invoiceData.fromAddress}({invoiceData.invoiceNumber})</span>
<span>{invoiceData.fromAddress}{' '}({invoiceData.invoiceNumber})</span>
</td>
</tr>
{invoiceData.toAddress && (
{invoiceData.destAddress && (
<>
<tr>
<td styleName="header" colSpan={2}>
<FormattedMessage { ...langLabels.toAddress } />
<FormattedMessage id="InvoiceInfoModal_ToAddress" defaultMessage="Payer address" />
</td>
</tr>
<tr styleName="responsiveBlock">
<td colSpan={2}>{invoiceData.toAddress}</td>
<tr>
<td styleName="responsiveBlock" colSpan={2}>{invoiceData.destAddress}</td>
</tr>
</>
)}
Expand Down
21 changes: 0 additions & 21 deletions src/front/shared/components/modals/InfoInvoice/images/ready.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ class WithdrawBtcPin extends React.Component<ComponentProps, ComponentState> {
data: txInfoCache,
})

helpers.transactions.pullTxBalances(txId, amount, beforeBalances, adminFee)

actions.loader.hide()
actions.btcmultisig.getBalancePin()
if (invoice) {
Expand Down
Loading