about summary refs log tree commit diff
path: root/src/screens/Profile/Header
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/Profile/Header')
-rw-r--r--src/screens/Profile/Header/EditProfileDialog.tsx33
-rw-r--r--src/screens/Profile/Header/SuggestedFollows.tsx3
2 files changed, 18 insertions, 18 deletions
diff --git a/src/screens/Profile/Header/EditProfileDialog.tsx b/src/screens/Profile/Header/EditProfileDialog.tsx
index 95160ce86..eb9e9179d 100644
--- a/src/screens/Profile/Header/EditProfileDialog.tsx
+++ b/src/screens/Profile/Header/EditProfileDialog.tsx
@@ -8,7 +8,6 @@ import {urls} from '#/lib/constants'
 import {cleanError} from '#/lib/strings/errors'
 import {useWarnMaxGraphemeCount} from '#/lib/strings/helpers'
 import {logger} from '#/logger'
-import {isWeb} from '#/platform/detection'
 import {type ImageMeta} from '#/state/gallery'
 import {useProfileUpdateMutation} from '#/state/queries/profile'
 import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
@@ -44,20 +43,6 @@ export function EditProfileDialog({
   const cancelControl = Dialog.useDialogControl()
   const [dirty, setDirty] = useState(false)
 
-  // 'You might lose unsaved changes' warning
-  useEffect(() => {
-    if (isWeb && dirty) {
-      const abortController = new AbortController()
-      const {signal} = abortController
-      window.addEventListener('beforeunload', evt => evt.preventDefault(), {
-        signal,
-      })
-      return () => {
-        abortController.abort()
-      }
-    }
-  }, [dirty])
-
   const onPressCancel = useCallback(() => {
     if (dirty) {
       cancelControl.open()
@@ -73,6 +58,15 @@ export function EditProfileDialog({
         preventDismiss: dirty,
         minHeight: SCREEN_HEIGHT,
       }}
+      webOptions={{
+        onBackgroundPress: () => {
+          if (dirty) {
+            cancelControl.open()
+          } else {
+            control.close()
+          }
+        },
+      }}
       testID="editProfileModal">
       <DialogInner
         profile={profile}
@@ -353,9 +347,14 @@ function DialogInner({
                 You are verified. You will lose your verification status if you
                 change your display name.{' '}
                 <InlineLinkText
-                  label={_(msg`Learn more`)}
+                  label={_(
+                    msg({
+                      message: `Learn more`,
+                      context: `english-only-resource`,
+                    }),
+                  )}
                   to={urls.website.blog.initialVerificationAnnouncement}>
-                  <Trans>Learn more.</Trans>
+                  <Trans context="english-only-resource">Learn more.</Trans>
                 </InlineLinkText>
               </Trans>
             </Admonition>
diff --git a/src/screens/Profile/Header/SuggestedFollows.tsx b/src/screens/Profile/Header/SuggestedFollows.tsx
index d005d888e..58a507e08 100644
--- a/src/screens/Profile/Header/SuggestedFollows.tsx
+++ b/src/screens/Profile/Header/SuggestedFollows.tsx
@@ -28,7 +28,6 @@ export function AnimatedProfileHeaderSuggestedFollows({
   actorDid: string
 }) {
   const gate = useGate()
-  if (!gate('post_follow_profile_suggested_accounts')) return null
 
   /* NOTE (caidanw):
    * Android does not work well with this feature yet.
@@ -37,6 +36,8 @@ export function AnimatedProfileHeaderSuggestedFollows({
    **/
   if (isAndroid) return null
 
+  if (!gate('post_follow_profile_suggested_accounts')) return null
+
   return (
     <AccordionAnimation isExpanded={isExpanded}>
       <ProfileHeaderSuggestedFollows actorDid={actorDid} />