From 20ffb1f6817c038817f264fbfc5e1325d12a7cef Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Mon, 11 Mar 2024 16:52:05 +0700 Subject: [PATCH 1/2] Use router redirect instead of hard redirect for iframe --- src/components/profile-selector/MyAccountMenu.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/profile-selector/MyAccountMenu.tsx b/src/components/profile-selector/MyAccountMenu.tsx index ad77d1021..486a61032 100644 --- a/src/components/profile-selector/MyAccountMenu.tsx +++ b/src/components/profile-selector/MyAccountMenu.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router' import React, { createContext, FC, useContext, useEffect, useRef, useState } from 'react' import { getCurrentUrlOrigin } from 'src/utils/url' import { InfoDetails } from '../profiles/address-views' @@ -78,6 +79,7 @@ function parseMessage(data: string) { export const AccountMenu: React.FunctionComponent = ({ address, owner }) => { const iframeRef = useRef(null) const [isOpenProfileModal, setIsOpenProfileModal] = useState(false) + const router = useRouter() useEffect(() => { window.onmessage = event => { @@ -87,7 +89,9 @@ export const AccountMenu: React.FunctionComponent = ({ address, ow const { name, value } = message if (name === 'profile' && value === 'close') { setIsOpenProfileModal(false) - } else if (name === 'redirect' || name === 'redirect-hard') { + } else if (name === 'redirect') { + router.push(value) + } else if (name === 'redirect-hard') { // Using router push for redirect don't redirect properly, it just have loading for a bit and changes the url much later window.location.href = value setIsOpenProfileModal(false) From f5f7fa4270782c81306b3d46c3131d112f2ac02c Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Mon, 11 Mar 2024 19:02:02 +0700 Subject: [PATCH 2/2] Make comment edit button loading when its loading --- src/components/comments/UpdateComment.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/comments/UpdateComment.tsx b/src/components/comments/UpdateComment.tsx index 5efa26112..db646d94e 100644 --- a/src/components/comments/UpdateComment.tsx +++ b/src/components/comments/UpdateComment.tsx @@ -54,6 +54,7 @@ export const EditComment: FC = ({ disabled, json, ipfs, + loading, setIpfsCid, onClick, onFailed, @@ -63,6 +64,7 @@ export const EditComment: FC = ({ type='primary' label='Update' disabled={disabled} + loading={loading} params={() => getTxParams({ json: json,