Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions moon/apps/web/pages/[org]/mr/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { usePostMrComment } from '@/hooks/usePostMrComment'
import { usePostMrMerge } from '@/hooks/usePostMrMerge'
import { usePostMrReopen } from '@/hooks/usePostMrReopen';
import { usePostMrClose } from '@/hooks/usePostMrClose';
import { useScope } from '@/contexts/scope'

interface MRDetail {
status: string,
Expand All @@ -41,9 +42,9 @@ export interface Conversation {
const MRDetailPage:PageWithLayout<any> = () =>{
const router = useRouter();
const { id : tempId, title } = router.query;

const { scope } = useScope()
const [editorState, setEditorState] = useState("");
const [login, _setLogin] = useState(false);
const [login, _setLogin] = useState(true);
const [outputHtml, setOutputHtml] = useState('');

const id = typeof tempId === 'string' ? tempId : '';
Expand Down Expand Up @@ -72,7 +73,7 @@ const MRDetailPage:PageWithLayout<any> = () =>{
const handleMrApprove = () => {
approveMr(undefined, {
onSuccess: () => {
router.push("/mr")
router.push(`/${scope}/mr`)
},
})
}
Expand All @@ -81,7 +82,7 @@ const MRDetailPage:PageWithLayout<any> = () =>{
const handleMrClose = () => {
closeMr(undefined, {
onSuccess: () => {
router.push("/mr")
router.push(`/${scope}/mr`)
},
})
}
Expand All @@ -90,7 +91,7 @@ const MRDetailPage:PageWithLayout<any> = () =>{
const handleMrReopen = () => {
reopenMr(undefined,{
onSuccess: () => {
router.push("/mr")
router.push(`/${scope}/mr`)
},
})
}
Expand Down Expand Up @@ -167,7 +168,7 @@ const MRDetailPage:PageWithLayout<any> = () =>{
</Button>
}
<Button
// disabled={!login}
disabled={!login}
onClick={() => save_comment()}
aria-label="Comment"
className={cn(buttonClasses)}
Expand Down