diff --git a/frontend/src/screens/LandingPageScreen/LandingPageScreen.tsx b/frontend/src/screens/LandingPageScreen/LandingPageScreen.tsx index 6031909..61a88d2 100644 --- a/frontend/src/screens/LandingPageScreen/LandingPageScreen.tsx +++ b/frontend/src/screens/LandingPageScreen/LandingPageScreen.tsx @@ -152,7 +152,7 @@ export function LandingPageScreen() { className="absolute inset-0 bg-gradient-to-b from-red-50 to-blue-50 pointer-events-none border-t-2 border-b-2 border-amber-500" aria-hidden="true">
-

Pay what you want.

+

Plans

@@ -167,7 +167,7 @@ export function LandingPageScreen() { Core features will always be free.

    - {["No Watch Limit", "Real-time Notifications", "Push Notifications", "Discord Notifications", "Web Hook Notifications"].map(x => ( + {["No Watch Limit", "Real-time Notifications", "Push Notifications", "Discord Notifications", "Web Hook Notifications", "Email Notifications"].map(x => (
  • }> {x} @@ -181,36 +181,6 @@ export function LandingPageScreen() {
-
-

- Pro -

-

- $2.99 - / semester -

-

- Support hosting costs and get access to expensive notification channels. -

-
    - {["All Always Free Features", "Email Notifications", "Text Notifications"].map(x => ( -
  • - }> - {x} -
  • - ))} -
  •  
  • -
  •  
  • -
-
- - - -
-
diff --git a/frontend/src/screens/ProfileScreen/ProfileScreen.tsx b/frontend/src/screens/ProfileScreen/ProfileScreen.tsx index f53ce1d..f952f2b 100644 --- a/frontend/src/screens/ProfileScreen/ProfileScreen.tsx +++ b/frontend/src/screens/ProfileScreen/ProfileScreen.tsx @@ -170,7 +170,7 @@ function CurrentSubscriptions() { } export function NotificationSettingsBody() { - const {isAuthed, isPro, getUser} = useContext(AuthContext); + const {isAuthed, getUser} = useContext(AuthContext); const [discordUrl, setDiscordUrl] = useState(''); const [email, setEmail] = useState(''); @@ -275,9 +275,8 @@ export function NotificationSettingsBody() { onChange={(e: any) => setWebhookUrl(e.target.value)} /> ({}); - - useEffect(() => { - return onValue(ref(realtime_db, `user_settings/${getUser()?.uid}/paid_plan`), e => { - setPaidPlans(e.val() ?? {}); - }); - }, [semesters, isAuthed]); - - const plan = isPro ? "Pro Tier" : "Always Free"; - - const buyButtonId = import.meta.env.DEV ? "buy_btn_1N4THPFyZ0MspKh2OH5rczga" : "buy_btn_1N4T5KFyZ0MspKh2ZZmuwlSd"; - const publishableKey = import.meta.env.DEV ? - "pk_test_51N2zqNFyZ0MspKh2ziT2o0XlXZ9Ab9tczmlyeqX3iTrBygPsi6mUFOG0qCrdGR0bsHuVZBsJF2VZEDbu4GMDxH05007U7bSWDa" : - "pk_live_51N2zqNFyZ0MspKh2k6z4TTBrmqza1YpomBOa5MJemzMYLz9oVyZiD7hwMx9lIjnu53y7GbFzSFpN8zC2oi4LLIat00DYmRZjeW"; - - return ( - <> - Your Plan - Your current Waitlist Watcher plan is {plan} for {semester.name}. - {plan !== "Pro Tier" && semester.id === "202401" && -
- - Upgrade to Pro for $2.99 / semester (charged once). - -
- -
- } -
- Your plan for other semesters: - {Object.keys(semesters).map(x => { - if (x === semester.name) return null; - return ( -
- {semesters[x].name} - {paidPlans[x] === "pro" ? "Pro Tier" : "Always Free"} -
- ) - })} -
- - ) -} - export function ProfileScreen() { const {isAuthed, getUser} = useContext(AuthContext); useTitle("User Settings"); @@ -422,20 +369,11 @@ export function ProfileScreen() { description="Used only for login purposes" value={getUser()?.email ?? ""} /> - {/**/} - - - - diff --git a/functions/src/notifier/notifier.ts b/functions/src/notifier/notifier.ts index fcaa4ce..b0797d1 100644 --- a/functions/src/notifier/notifier.ts +++ b/functions/src/notifier/notifier.ts @@ -105,15 +105,8 @@ export const sendNotifications = async (event: CloudEvent) const subscription_methods = await rtdb.ref("user_settings/" + key).once('value'); if (!subscription_methods.exists()) continue; - const paid_plan = await rtdb.ref(`user_settings/${key}/paid_plan/${semester}`).once('value'); - let pro = false; - if (paid_plan.exists() && paid_plan.val() === "pro") { - pro = true; - } - const sub_methods = subscription_methods.val(); - - promises.push(publishNotifications(sub_methods, key, event, pro)); + promises.push(publishNotifications(sub_methods, key, event)); } } diff --git a/functions/src/notifier/send.ts b/functions/src/notifier/send.ts index 79d26e9..ffb74a4 100644 --- a/functions/src/notifier/send.ts +++ b/functions/src/notifier/send.ts @@ -78,7 +78,7 @@ export const sendEmailNotification = async (email: string, event: CourseEvent | }), event); } -export const publishNotifications = async (sub_methods: any, key: string, event: CourseEvent | TestNotificationEvent, is_pro: boolean) => { +export const publishNotifications = async (sub_methods: any, key: string, event: CourseEvent | TestNotificationEvent) => { const promises = []; if (sub_methods.web_hook) { console.log("Notifying", key, "through a web hook"); @@ -92,11 +92,9 @@ export const publishNotifications = async (sub_methods: any, key: string, event: console.log("Notifying", key, "through a discord web hook") promises.push(sendDiscordNotification(sub_methods.discord, event)); } - if (is_pro) { - if (sub_methods.email) { - console.log("Notifying", key, "through an email") - promises.push(sendEmailNotification(sub_methods.email, event, key)); - } + if (sub_methods.email) { + console.log("Notifying", key, "through an email") + promises.push(sendEmailNotification(sub_methods.email, event, key)); } return Promise.all(promises); diff --git a/functions/src/notifier/test_notify.ts b/functions/src/notifier/test_notify.ts index 7fa05dd..157ef5f 100644 --- a/functions/src/notifier/test_notify.ts +++ b/functions/src/notifier/test_notify.ts @@ -12,8 +12,6 @@ export async function testNotify(data: any, context: CallableContext) { const subscription_methods = await rtdb.ref("user_settings/" + userid).once('value'); if (!subscription_methods.exists()) return; - const pro = (await rtdb.ref(`user_settings/${userid}/paid_plan/`).once('value')).exists(); - const sub_methods = subscription_methods.val(); await publishNotifications(sub_methods, userid, { @@ -26,7 +24,7 @@ export async function testNotify(data: any, context: CallableContext) { section: "101", new: "New Value", old: "Old Value", - }, pro); + }); return {success: true}; }