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
package/dist/index.mjs
CHANGED
|
@@ -20630,7 +20630,8 @@ var SendActivityModal = ({
|
|
|
20630
20630
|
categories: initialCategories,
|
|
20631
20631
|
onCategoriesChange,
|
|
20632
20632
|
isLoading = false,
|
|
20633
|
-
onError
|
|
20633
|
+
onError,
|
|
20634
|
+
initialData
|
|
20634
20635
|
}) => {
|
|
20635
20636
|
const store = useSendActivityModalStore();
|
|
20636
20637
|
const reset = useSendActivityModalStore((state) => state.reset);
|
|
@@ -20641,16 +20642,30 @@ var SendActivityModal = ({
|
|
|
20641
20642
|
(state) => state.categories
|
|
20642
20643
|
);
|
|
20643
20644
|
const categoriesInitialized = useRef22(false);
|
|
20645
|
+
const prevInitialDataRef = useRef22(
|
|
20646
|
+
void 0
|
|
20647
|
+
);
|
|
20644
20648
|
useEffect41(() => {
|
|
20645
20649
|
if (isOpen && initialCategories.length > 0 && !categoriesInitialized.current) {
|
|
20646
20650
|
setCategories(initialCategories);
|
|
20647
20651
|
categoriesInitialized.current = true;
|
|
20648
20652
|
}
|
|
20649
20653
|
}, [isOpen, initialCategories, setCategories]);
|
|
20654
|
+
useEffect41(() => {
|
|
20655
|
+
if (isOpen && initialData && prevInitialDataRef.current !== initialData) {
|
|
20656
|
+
store.setFormData({
|
|
20657
|
+
title: initialData.title ?? "",
|
|
20658
|
+
subtype: initialData.subtype ?? "TAREFA",
|
|
20659
|
+
notification: initialData.notification ?? ""
|
|
20660
|
+
});
|
|
20661
|
+
prevInitialDataRef.current = initialData;
|
|
20662
|
+
}
|
|
20663
|
+
}, [isOpen, initialData, store]);
|
|
20650
20664
|
useEffect41(() => {
|
|
20651
20665
|
if (!isOpen) {
|
|
20652
20666
|
reset();
|
|
20653
20667
|
categoriesInitialized.current = false;
|
|
20668
|
+
prevInitialDataRef.current = void 0;
|
|
20654
20669
|
}
|
|
20655
20670
|
}, [isOpen, reset]);
|
|
20656
20671
|
const handleCategoriesChange = useCallback17(
|