diff --git a/web/cashtab/src/components/App.js b/web/cashtab/src/components/App.js --- a/web/cashtab/src/components/App.js +++ b/web/cashtab/src/components/App.js @@ -1,6 +1,6 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import 'antd/dist/antd.less'; -import { Spin } from 'antd'; +import { Modal, Spin } from 'antd'; import { CashLoadingIcon } from '@components/Common/CustomIcons'; import '../index.css'; import styled, { ThemeProvider, createGlobalStyle } from 'styled-components'; @@ -33,6 +33,7 @@ import TabCash from '@assets/tabcash.png'; import ABC from '@assets/logo_topright.png'; import { checkForTokenById } from '@utils/tokenMethods.js'; +import { currency } from './Common/Ticker'; const GlobalStyle = createGlobalStyle` .ant-modal-wrap > div > div.ant-modal-content > div > div > div.ant-modal-confirm-btns > button, .ant-modal > button, .ant-modal-confirm-btns > button, .ant-modal-footer > button { @@ -235,6 +236,41 @@ ) : false; + useEffect(() => { + // If URL is not as specified in currency.appURL in Ticker.js, show a popup + const currentUrl = window.location.hostname; + if (currentUrl !== currency.appUrl) { + console.log( + `Loaded URL ${currentUrl} does not match app URL ${currency.appUrl}!`, + ); + Modal.warning({ + title: 'Cashtab is moving!', + content: ( +
+

+ Cashtab is moving to a new home at{' '} + + Cashtab.com + +

+

+ Please write down your wallet 12-word seed and + import it at the new domain. +

+

+ At the end of the month, cashtabapp.com will + auto-fwd to cashtab.com after one minute. +

+
+ ), + }); + } + }, []); + return ( diff --git a/web/cashtab/src/components/Common/Ticker.js b/web/cashtab/src/components/Common/Ticker.js --- a/web/cashtab/src/components/Common/Ticker.js +++ b/web/cashtab/src/components/Common/Ticker.js @@ -6,6 +6,7 @@ export const currency = { name: 'eCash', ticker: 'XEC', + appUrl: 'cashtabapp.com', logo: mainLogo, legacyPrefix: 'bitcoincash', prefixes: ['ecash'],