Skip to content

Commit

Permalink
Merge pull request #339 from dappforce/improvements
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
olehmell authored Mar 11, 2024
2 parents 4df0fbd + f5f7fa4 commit 990e72d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/comments/UpdateComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const EditComment: FC<EditCommentProps> = ({
disabled,
json,
ipfs,
loading,
setIpfsCid,
onClick,
onFailed,
Expand All @@ -63,6 +64,7 @@ export const EditComment: FC<EditCommentProps> = ({
type='primary'
label='Update'
disabled={disabled}
loading={loading}
params={() =>
getTxParams({
json: json,
Expand Down
6 changes: 5 additions & 1 deletion src/components/profile-selector/MyAccountMenu.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -78,6 +79,7 @@ function parseMessage(data: string) {
export const AccountMenu: React.FunctionComponent<AddressProps> = ({ address, owner }) => {
const iframeRef = useRef<HTMLIFrameElement | null>(null)
const [isOpenProfileModal, setIsOpenProfileModal] = useState(false)
const router = useRouter()

useEffect(() => {
window.onmessage = event => {
Expand All @@ -87,7 +89,9 @@ export const AccountMenu: React.FunctionComponent<AddressProps> = ({ 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)
Expand Down

0 comments on commit 990e72d

Please sign in to comment.