@umituz/react-native-ai-generation-content 1.61.7 → 1.61.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.61.7",
3
+ "version": "1.61.8",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -70,10 +70,12 @@ export function useGalleryCallbacks(props: UseGalleryCallbacksProps) {
70
70
  );
71
71
 
72
72
  const handleFavorite = useCallback(
73
- (c: Creation, isFavorite: boolean) => {
73
+ (c: Creation) => {
74
74
  void (async () => {
75
75
  if (!userId) return;
76
- const success = await repository.updateFavorite(userId, c.id, isFavorite);
76
+ // Toggle the favorite status
77
+ const newFavoriteStatus = !c.isFavorite;
78
+ const success = await repository.updateFavorite(userId, c.id, newFavoriteStatus);
77
79
  if (success) void refetch();
78
80
  })();
79
81
  },
@@ -114,7 +114,7 @@ export function CreationsGalleryScreen({
114
114
  onPress: () => callbacks.handleCardPress(item),
115
115
  onShare: async () => callbacks.handleShareCard(item),
116
116
  onDelete: () => callbacks.handleDelete(item),
117
- onFavorite: () => callbacks.handleFavorite(item, !item.isFavorite),
117
+ onFavorite: () => callbacks.handleFavorite(item),
118
118
  }}
119
119
  />
120
120
  ), [callbacks, getScenarioTitle]);