aport-tools 4.4.25 → 4.4.26

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/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v4.4.25 | ISC */
1
+ /*! aport-tools v4.4.26 | ISC */
2
2
  import React, { useContext, useState, createContext, useRef, useEffect, useMemo, useCallback } from 'react';
3
3
  import { StyleSheet, Text as Text$1, Animated, View, TouchableOpacity, Image, TextInput, Modal, Pressable, FlatList, Keyboard, Platform, Alert, ActivityIndicator } from 'react-native';
4
4
  import { ThemeContext } from 'aport-themes';
@@ -1147,18 +1147,19 @@ var InputAttach = function InputAttach(_a) {
1147
1147
  var _g = useFormContext(),
1148
1148
  setFormValue = _g.setFormValue,
1149
1149
  formErrors = _g.errors;
1150
- // Initialize with firstValue or an empty array
1151
- var _h = useState(function () {
1152
- return Array.isArray(firstValue) ? firstValue.slice(0, amount) : [];
1153
- }),
1150
+ var _h = useState([]),
1154
1151
  selectedFiles = _h[0],
1155
1152
  setSelectedFiles = _h[1];
1156
- // Update the form context on mount with firstValue if provided
1153
+ // Ref to track initialization
1154
+ var isInitialized = useRef(false);
1155
+ // Sync firstValue with selectedFiles when it changes
1157
1156
  useEffect(function () {
1158
- if (firstValue.length > 0) {
1159
- setFormValue(name, firstValue.slice(0, amount));
1157
+ if (!isInitialized.current) {
1158
+ setSelectedFiles(firstValue);
1159
+ setFormValue(name, firstValue); // Update form context
1160
+ isInitialized.current = true;
1160
1161
  }
1161
- }, [firstValue, name, setFormValue, amount]);
1162
+ }, [firstValue, name, setFormValue]);
1162
1163
  var theme = useContext(ThemeContext).theme;
1163
1164
  var colors = theme.colors;
1164
1165
  var pickImage = function pickImage() {