diff --git a/src/components/main/ChangePasswordPop.jsx b/src/components/main/ChangePasswordPop.jsx index efae3bb5..28dc537c 100644 --- a/src/components/main/ChangePasswordPop.jsx +++ b/src/components/main/ChangePasswordPop.jsx @@ -2,12 +2,13 @@ import { useContext } from 'react' import { useMessage } from '@/hooks/useMessage' import { useForm } from 'react-hook-form' import { sessionStore } from '@/store/commonAtom' -import { useRecoilValue, useRecoilState } from 'recoil' +import { useRecoilState, useRecoilValue } from 'recoil' import { useAxios } from '@/hooks/useAxios' import { globalLocaleStore } from '@/store/localeAtom' -import { logout, setSession, login } from '@/lib/authActions' +import { login, logout, setSession } from '@/lib/authActions' import { useSwal } from '@/hooks/useSwal' import { QcastContext } from '@/app/QcastProvider' +import { useRouter } from 'next/navigation' export default function ChangePasswordPop(props) { const globalLocaleState = useRecoilValue(globalLocaleStore) @@ -18,6 +19,7 @@ export default function ChangePasswordPop(props) { const { patch } = useAxios(globalLocaleState) const { getMessage } = useMessage() const [sessionState, setSessionState] = useRecoilState(sessionStore) + const router = useRouter() const formInitValue = { password1: '', password2: '', @@ -128,12 +130,14 @@ export default function ChangePasswordPop(props) { } else { setIsGlobalLoading(false) logout() + router.replace('/login', undefined, { shallow: true }) console.log('code not 200 error') } }) .catch((error) => { setIsGlobalLoading(false) logout() + router.replace('/login', undefined, { shallow: true }) console.log('catch::::::::', error) }) } @@ -207,6 +211,7 @@ export default function ChangePasswordPop(props) { className="btn-origin grey" onClick={() => { logout() + router.replace('/login', undefined, { shallow: true }) }} > {getMessage('main.popup.login.btn2')} diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 0899afcb..88980cad 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -3094,7 +3094,7 @@ export const useTrestle = () => { ) } if (!halfBottomRightModule) { - halfBottomRightPoint = { x: x + w, y: y - height / 2 } + halfBottomRightPoint = { x: x + w, y: y + height / 2 } halfBottomRightModule = centerPoints.find( (centerPoint) => Math.abs(centerPoint.x - halfBottomRightPoint.x) < maxX && Math.abs(centerPoint.y - halfBottomRightPoint.y) < maxY, ) diff --git a/src/hooks/useLine.js b/src/hooks/useLine.js index 30cc9ba9..3e1d72e6 100644 --- a/src/hooks/useLine.js +++ b/src/hooks/useLine.js @@ -10,7 +10,7 @@ import { } from '@/store/canvasAtom' import { QLine } from '@/components/fabric/QLine' import { basicSettingState } from '@/store/settingAtom' -import { calcLineActualSizeByLineLength } from '@/util/qpolygon-utils' +import { calcLineActualSizeByLineLength, calcLinePlaneSize } from '@/util/qpolygon-utils' import { getDegreeByChon } from '@/util/canvas-util' import { useText } from '@/hooks/useText' import { fontSelector } from '@/store/fontAtom' @@ -31,6 +31,7 @@ export const useLine = () => { const addLine = (points = [], options) => { const line = new QLine(points, { ...options, + attributes: {}, fontSize: lengthText.fontSize.value, fontFamily: lengthText.fontFamily.value, }) @@ -38,7 +39,7 @@ export const useLine = () => { if (line.length < 1) { return null } - + line.attributes.planeSize = calcLinePlaneSize(line) canvas?.add(line) return line }