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> </body>
<script> <script>
if (window.opener) { 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() { function clearPasswordForm() {
document.getElementById("oldPassword").value = ""; document.getElementById("oldPassword").value = "";

View File

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