This commit is contained in:
lingdocs 2021-08-23 10:34:17 +04:00
parent f8d8915c60
commit 344c09c2ce
2 changed files with 2 additions and 5 deletions

View File

@ -140,7 +140,8 @@
</body>
<script>
if (window.opener) {
window.opener.postMessage("signed in", "*");
window.opener.postMessage("signed in", "https://dev.dictionary.lingdocs.com");
window.opener.postMessage("signed in", "https://dictionary.lingdocs.com");
}
function clearPasswordForm() {
document.getElementById("oldPassword").value = "";

View File

@ -36,10 +36,7 @@ const Account = ({ user, loadUser }: { user: AT.LingdocsUser | undefined, loadUs
// eslint-disable-next-line
}, []);
function handleIncomingMessage(event: MessageEvent<any>) {
console.log("message incoming", event.data);
console.log("popup is", popupRef);
if (event.data === "signed in" && popupRef) {
console.log("will execute");
loadUser();
popupRef.close();
}
@ -54,7 +51,6 @@ const Account = ({ user, loadUser }: { user: AT.LingdocsUser | undefined, loadUs
setWaiting(true);
upgradeAccount(upgradePassword).then((res) => {
setWaiting(false);
console.log("password", upgradePassword, "response", res);
if (res.ok) {
loadUser();
closeUpgrade();