Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#654 광고성 알림 수신 동의 받기 #663

Merged
merged 4 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions src/components/ModalPopup/ModalMypageModify.tsx
14KGun marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ const ModalMypageModify = ({
method: "post",
data: { nickname },
onError: () => setAlert(t("page_modify.nickname_failed")),
//#region event2023Fall
onSuccess: () => event2023FallQuestComplete("nicknameChanging"), // event2023Fall
//#endregion
});
}
if (account !== loginInfo?.account) {
Expand All @@ -188,7 +190,9 @@ const ModalMypageModify = ({
method: "post",
data: { account },
onError: () => setAlert(t("page_modify.account_failed")),
//#region event2023Fall
onSuccess: () => event2023FallQuestComplete("accountChanging"), // event2023Fall
//#endregion
});
}
if (isNeedToUpdateLoginInfo) {
Expand Down
23 changes: 23 additions & 0 deletions src/components/ModalPopup/ModalNotification.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback, useRef } from "react";
import { useTranslation } from "react-i18next";

import { useEvent2023FallQuestComplete } from "hooks/event/useEvent2023FallQuestComplete";
import {
useFetchRecoilState,
useValueRecoilState,
Expand Down Expand Up @@ -64,6 +65,9 @@ const ModalNotification = ({
const notificationOptions = useValueRecoilState("notificationOptions");
const fetchNotificationOptions = useFetchRecoilState("notificationOptions");
const isAxiosCalled = useRef(false);
//#region event2023Fall
const event2023FallQuestComplete = useEvent2023FallQuestComplete();
//#endregion

const styleTitle = {
...theme.font18,
Expand Down Expand Up @@ -108,6 +112,11 @@ const ModalNotification = ({
});
fetchNotificationOptions();
isAxiosCalled.current = false;

//#region event2023Fall
if (optionName === "advertisement" && value)
event2023FallQuestComplete("adPushAgreement");
//#endregion
},
[deviceToken]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependency에 event2023FallQuestComplete 추가해야하지 않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아앗 추가했습니다 !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다!

);
Expand All @@ -133,11 +142,16 @@ const ModalNotification = ({
beforeDepart: value,
chatting: value,
notice: value,
advertisement: value,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

궁금한게 있는데 이 여러 옵션들이 value하나로 묶여있어도 되는건가요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 전체 알림 끄고 키는 핸들러에요! ㅎ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 글쿤요!

},
});
fetchNotificationOptions();
isAxiosCalled.current = false;

//#region event2023Fall
if (value) event2023FallQuestComplete("adPushAgreement");
//#endregion
},
[deviceToken]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

마찬가지 입니당

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것두 추가했어요 !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다!

);
Expand All @@ -153,6 +167,10 @@ const ModalNotification = ({
onChangeNotificationOption("notice"),
[onChangeNotificationOption]
);
const onChangeNotificationAdvertisement = useCallback(
onChangeNotificationOption("advertisement"),
[onChangeNotificationOption]
);

return (
<Modal
Expand Down Expand Up @@ -197,6 +215,11 @@ const ModalNotification = ({
value={!!notificationOptions?.notice}
onChangeValue={onChangeNotificationNotice}
/>
<SelectNotification
text="광고성 알림"
value={!!notificationOptions?.advertisement}
onChangeValue={onChangeNotificationAdvertisement}
/>
</div>
</>
) : (
Expand Down
5 changes: 3 additions & 2 deletions src/tools/trans.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ const getLocationName = (location, langPreference) => {

const isNotificationOn = (notificationOptions) => {
const isOn =
// notificationOptions?.advertisement ||
// notificationOptions?.beforeDepart ||
notificationOptions?.chatting || notificationOptions?.notice;
notificationOptions?.advertisement ||
notificationOptions?.chatting ||
notificationOptions?.notice;
// notificationOptions?.keywords?.length;
return !!isOn;
};
Expand Down