Skip to content

Commit

Permalink
Merge branch 'main' into update-alert
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh authored Jul 19, 2023
2 parents ede008f + 26bfd05 commit b4a3c60
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ function NotificationPreference({

const [selectedTopic, setSelectedTopic] = useState<number[]>([])

const notFillEmail = !inputEmail

const updateTopicGroupsLocal = useCallback(
(subIds: number[], unsubIds: number[]) => {
const newTopicGroups = topicGroupsGlobal.map(group => {
Expand Down Expand Up @@ -295,7 +293,7 @@ function NotificationPreference({
const isVerifiedEmail = userInfo?.email && inputEmail === userInfo?.email
const needVerifyEmail = inputEmail && inputEmail !== userInfo?.email

const disableCheckbox = needVerifyEmail || notFillEmail || hasErrorInput
const disableCheckbox = hasErrorInput
const isIncludePriceAlert = useCallback(() => {
const changedData = getDiffChangeTopics(topicGroups)
return (
Expand All @@ -315,7 +313,7 @@ function NotificationPreference({

const checkProfileAndSave = () => {
if (disableButtonSave) return
if (!userInfo?.email && !isIncludePriceAlert()) {
if (needVerifyEmail && !isIncludePriceAlert()) {
showVerifyModal()
return
}
Expand Down

0 comments on commit b4a3c60

Please sign in to comment.