Skip to content

Commit

Permalink
refactor: update order condition check for author visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Mar 5, 2025
1 parent 12275b6 commit 4f400a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/service/question_common/question.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ func (qs *QuestionCommon) FormatQuestionsPage(
}
}

// if order condition is newest or nobody edited or nobody answered, only show question author
if orderCond == schema.QuestionOrderCondNewest || (!haveEdited && !haveAnswered) {
// If the order condition is not active or no one has edited/answered, display only the question author
if orderCond != schema.QuestionOrderCondActive || (!haveEdited && !haveAnswered) {
t.OperationType = schema.QuestionPageRespOperationTypeAsked
t.OperatedAt = questionInfo.CreatedAt.Unix()
t.Operator = &schema.QuestionPageRespOperator{ID: questionInfo.UserID}
Expand Down

0 comments on commit 4f400a4

Please sign in to comment.