diff options
Diffstat (limited to 'src/webex/pages')
| -rw-r--r-- | src/webex/pages/confirm-contract.tsx | 6 | ||||
| -rw-r--r-- | src/webex/pages/popup.tsx | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/webex/pages/confirm-contract.tsx b/src/webex/pages/confirm-contract.tsx index 41eebda8e..d24613794 100644 --- a/src/webex/pages/confirm-contract.tsx +++ b/src/webex/pages/confirm-contract.tsx @@ -25,6 +25,8 @@ */ import * as i18n from "../../i18n"; +import { runOnceWhenReady } from "./common"; + import { ExchangeRecord, ProposalDownloadRecord, @@ -372,7 +374,7 @@ class ContractPrompt extends React.Component<ContractPromptProps, ContractPrompt <i18n.Translate wrap="p"> The merchant{" "}<span>{merchantName}</span> offers you to purchase: </i18n.Translate> - <div style={{"text-align": "center"}}> + <div style={{"textAlign": "center"}}> <strong>{c.summary}</strong> </div> <strong></strong> @@ -395,7 +397,7 @@ class ContractPrompt extends React.Component<ContractPromptProps, ContractPrompt } -document.addEventListener("DOMContentLoaded", () => { +runOnceWhenReady(() => { const url = new URI(document.location.href); const query: any = URI.parseQuery(url.query()); diff --git a/src/webex/pages/popup.tsx b/src/webex/pages/popup.tsx index 6d0134b84..2224a662f 100644 --- a/src/webex/pages/popup.tsx +++ b/src/webex/pages/popup.tsx @@ -27,6 +27,8 @@ */ import * as i18n from "../../i18n"; +import { runOnceWhenReady } from "./common"; + import { AmountJson } from "../../amounts"; import * as Amounts from "../../amounts"; @@ -41,6 +43,7 @@ import * as wxApi from "../wxApi"; import * as React from "react"; import * as ReactDOM from "react-dom"; + import URI = require("urijs"); function onUpdateNotification(f: () => void): () => void { @@ -571,7 +574,7 @@ const el = ( </div> ); -document.addEventListener("DOMContentLoaded", () => { +runOnceWhenReady(() => { ReactDOM.render(el, document.getElementById("content")!); // Will be used by the backend to detect when the popup gets closed, // so we can clear notifications |
