Skip to content

Commit

Permalink
Only show privacy policy notice on Gitpod Cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Oct 30, 2023
1 parent 17f7b6c commit 0e0c360
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions components/dashboard/src/AppNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
* See License-AGPL.txt in the project root for license information.
*/

import dayjs from "dayjs";
import deepMerge from "deepmerge";
import { useCallback, useEffect, useState } from "react";
import Alert, { AlertType } from "./components/Alert";
import dayjs from "dayjs";
import { useUserLoader } from "./hooks/use-user-loader";
import { getGitpodService } from "./service/service";
import deepMerge from "deepmerge";
import { isGitpodIo } from "./utils";

const KEY_APP_DISMISSED_NOTIFICATIONS = "gitpod-app-notifications-dismissed";
const PRIVACY_POLICY_LAST_UPDATED = "2023-10-17";
Expand Down Expand Up @@ -48,10 +49,10 @@ export function AppNotifications() {

useEffect(() => {
const notifications = [];
if (!loading && user?.additionalData?.profile) {
if (!loading && isGitpodIo()) {
if (
!user.additionalData.profile.acceptedPrivacyPolicyDate ||
new Date(PRIVACY_POLICY_LAST_UPDATED) > new Date(user.additionalData.profile?.acceptedPrivacyPolicyDate)
!user?.additionalData?.profile?.acceptedPrivacyPolicyDate ||
new Date(PRIVACY_POLICY_LAST_UPDATED) > new Date(user.additionalData.profile.acceptedPrivacyPolicyDate)
) {
notifications.push(UPDATED_PRIVACY_POLICY);
}
Expand Down

0 comments on commit 0e0c360

Please sign in to comment.