Skip to content

Commit

Permalink
Hide all the details or only the review
Browse files Browse the repository at this point in the history
  • Loading branch information
amieiro committed Jun 17, 2024
1 parent effe5c9 commit 00a0ced
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ jQuery( function( $ ) {
if ( nextEditor.length ) {
cacheTranslationHelpersForARow( nextEditor );
}

if ( chatgpt_review_enabled && $gp_comment_feedback_settings.openai_key && $gp_editor_options.can_approve && ( 'waiting' === translation_status || 'fuzzy' === translation_status ) ) {
fetchOpenAIReviewResponse( rowId, tr, false );
if ( ! $gp_comment_feedback_settings.openai_key || ! $gp_editor_options.can_approve || ( 'waiting' !== translation_status && 'fuzzy' !== translation_status ) ) {
tr.find( '.details-chatgpt' ).hide();
} else if ( ! chatgpt_review_enabled ) {
tr.find( '.openai-review' ).hide();
} else {
tr.find( '.details-chatgpt, .openai-review' ).hide();
fetchOpenAIReviewResponse( rowId, tr, false );
}
} );

Expand Down

0 comments on commit 00a0ced

Please sign in to comment.