Skip to content

Commit e66455b

Browse files
fix(mobile): save the latest staged model from native toolbar
1 parent 87c2f15 commit e66455b

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎apps/mobile/src/features/threads/ThreadSettingsSheet.tsx‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ import { useNavigation, useRoute, type RouteProp } from "@react-navigation/nativ
2828
import { type NativeStackNavigationProp } from "@react-navigation/native-stack";
2929
import * as Haptics from "expo-haptics";
3030
import { AsyncResult } from "effect/reactivity";
31-
import { createContext, use, useEffect, useRef, useState, type ReactNode } from "react";
31+
import {
32+
createContext,
33+
use,
34+
useEffect,
35+
useEffectEvent,
36+
useRef,
37+
useState,
38+
type ReactNode,
39+
} from "react";
3240
import { Platform, Pressable, RefreshControl, ScrollView, TextInput, View } from "react-native";
3341
import Animated, { FadeIn, FadeOut, LinearTransition } from "react-native-reanimated";
3442
import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -1127,10 +1135,10 @@ function ThreadSettingsModelsScreen() {
11271135
const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
11281136
const theme = useUniwindTheme();
11291137
const hasCustomCatalogFilter = session.providerFilter !== null || session.showLegacy;
1130-
const commitAndClose = () => {
1138+
const commitAndClose = useEffectEvent(() => {
11311139
if (!session.commitPendingModel()) return;
11321140
presentation.onClose();
1133-
};
1141+
});
11341142
const providerFilters = [
11351143
{ id: "all-providers", title: "All providers", value: null },
11361144
{ id: "favorites", title: "Favorites", value: FAVORITES_PROVIDER_FILTER },

0 commit comments

Comments
 (0)