File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const props = defineProps({
4242});
4343const snackbar = inject (" set-snackbar" );
4444const reviewSession = ref (false );
45- const disabled = ref (true );
45+ const disabled = ref (checkDisableStatus (props) );
4646
4747const error =
4848 props .text && props .session .draft && props .session .check ? .success === false ;
@@ -60,12 +60,18 @@ const reviewSessionHandle = async () => {
6060 }
6161};
6262
63- watch ([props], ([newProps ]) => {
64- disabled .value =
63+ function checkDisableStatus (newProps ) {
64+ if (! newProps .session ) return true ;
65+ return (
6566 ! newProps .session .draft ||
6667 newProps .session .state === " closed" ||
6768 ! newProps .session .check ||
68- ! newProps .session .check .success ;
69+ ! newProps .session .check .success
70+ );
71+ }
72+
73+ watch ([props], ([newProps ]) => {
74+ disabled .value = checkDisableStatus (newProps);
6975});
7076< / script>
7177
You can’t perform that action at this time.
0 commit comments