@@ -135,6 +135,9 @@ function ConfiguredSettingsRouteScreen() {
135135 const [ notificationStatus , setNotificationStatus ] = useState < NotificationStatus > ( "checking" ) ;
136136 const [ liveActivityStatus , setLiveActivityStatus ] = useState < LiveActivityStatus > ( "checking" ) ;
137137 const deviceRegistered = useDeviceRegistered ( ) ;
138+ const liveActivitiesPreferenceEnabled = AsyncResult . isSuccess ( preferencesResult )
139+ ? preferencesResult . value . liveActivitiesEnabled !== false
140+ : true ;
138141
139142 const connections = useMemo ( ( ) => Object . values ( savedConnectionsById ) , [ savedConnectionsById ] ) ;
140143 const environmentCount = connections . length ;
@@ -286,7 +289,7 @@ function ConfiguredSettingsRouteScreen() {
286289 runtime . runPromiseExit (
287290 setLiveActivityUpdatesEnabled ( {
288291 enabled : true ,
289- previousEnabled : false ,
292+ previousEnabled : liveActivitiesPreferenceEnabled ,
290293 clerkToken : tokenResult . value ,
291294 connections,
292295 } ) ,
@@ -323,7 +326,15 @@ function ConfiguredSettingsRouteScreen() {
323326 "This device could not be registered with T3 Connect, so Live Activities won't appear yet. They'll start once registration succeeds." ,
324327 ) ;
325328 }
326- } , [ connections , environmentCount , getToken , isSignedIn , promptSignIn , savePreferences ] ) ;
329+ } , [
330+ connections ,
331+ environmentCount ,
332+ getToken ,
333+ isSignedIn ,
334+ liveActivitiesPreferenceEnabled ,
335+ promptSignIn ,
336+ savePreferences ,
337+ ] ) ;
327338
328339 const handleDeviceNotificationsChange = useCallback (
329340 ( enabled : boolean ) => {
@@ -367,7 +378,7 @@ function ConfiguredSettingsRouteScreen() {
367378 runtime . runPromiseExit (
368379 setLiveActivityUpdatesEnabled ( {
369380 enabled : false ,
370- previousEnabled : true ,
381+ previousEnabled : liveActivitiesPreferenceEnabled ,
371382 clerkToken : token ,
372383 connections,
373384 } ) ,
@@ -393,7 +404,15 @@ function ConfiguredSettingsRouteScreen() {
393404
394405 void linkEnvironments ( ) ;
395406 } ,
396- [ connections , getToken , isSignedIn , linkEnvironments , promptSignIn , savePreferences ] ,
407+ [
408+ connections ,
409+ getToken ,
410+ isSignedIn ,
411+ linkEnvironments ,
412+ liveActivitiesPreferenceEnabled ,
413+ promptSignIn ,
414+ savePreferences ,
415+ ] ,
397416 ) ;
398417
399418 const openAccount = useCallback ( ( ) => {
0 commit comments