analytica-frontend-lib 1.2.46 → 1.2.47
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/SendActivityModal/index.js +16 -1
- package/dist/SendActivityModal/index.js.map +1 -1
- package/dist/SendActivityModal/index.mjs +16 -1
- package/dist/SendActivityModal/index.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -6124,7 +6124,8 @@ var SendActivityModal = ({
|
|
|
6124
6124
|
categories: initialCategories,
|
|
6125
6125
|
onCategoriesChange,
|
|
6126
6126
|
isLoading = false,
|
|
6127
|
-
onError
|
|
6127
|
+
onError,
|
|
6128
|
+
initialData
|
|
6128
6129
|
}) => {
|
|
6129
6130
|
const store = useSendActivityModalStore();
|
|
6130
6131
|
const reset = useSendActivityModalStore((state) => state.reset);
|
|
@@ -6135,16 +6136,30 @@ var SendActivityModal = ({
|
|
|
6135
6136
|
(state) => state.categories
|
|
6136
6137
|
);
|
|
6137
6138
|
const categoriesInitialized = (0, import_react17.useRef)(false);
|
|
6139
|
+
const prevInitialDataRef = (0, import_react17.useRef)(
|
|
6140
|
+
void 0
|
|
6141
|
+
);
|
|
6138
6142
|
(0, import_react17.useEffect)(() => {
|
|
6139
6143
|
if (isOpen && initialCategories.length > 0 && !categoriesInitialized.current) {
|
|
6140
6144
|
setCategories(initialCategories);
|
|
6141
6145
|
categoriesInitialized.current = true;
|
|
6142
6146
|
}
|
|
6143
6147
|
}, [isOpen, initialCategories, setCategories]);
|
|
6148
|
+
(0, import_react17.useEffect)(() => {
|
|
6149
|
+
if (isOpen && initialData && prevInitialDataRef.current !== initialData) {
|
|
6150
|
+
store.setFormData({
|
|
6151
|
+
title: initialData.title ?? "",
|
|
6152
|
+
subtype: initialData.subtype ?? "TAREFA",
|
|
6153
|
+
notification: initialData.notification ?? ""
|
|
6154
|
+
});
|
|
6155
|
+
prevInitialDataRef.current = initialData;
|
|
6156
|
+
}
|
|
6157
|
+
}, [isOpen, initialData, store]);
|
|
6144
6158
|
(0, import_react17.useEffect)(() => {
|
|
6145
6159
|
if (!isOpen) {
|
|
6146
6160
|
reset();
|
|
6147
6161
|
categoriesInitialized.current = false;
|
|
6162
|
+
prevInitialDataRef.current = void 0;
|
|
6148
6163
|
}
|
|
6149
6164
|
}, [isOpen, reset]);
|
|
6150
6165
|
const handleCategoriesChange = (0, import_react17.useCallback)(
|