@wallavi/widget 1.2.0 → 1.2.1
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.js +4 -3
- package/dist/index.mjs +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -752,8 +752,8 @@ function BubbleWidget({
|
|
|
752
752
|
const autoOpenedRef = react.useRef(false);
|
|
753
753
|
react.useEffect(() => {
|
|
754
754
|
if (!autoOpen || autoOpenedRef.current) return;
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
755
|
+
const dismissedUntil = Number(localStorage.getItem("wallavi_bubble_dismissed") ?? 0);
|
|
756
|
+
if (dismissedUntil < Date.now()) {
|
|
757
757
|
autoOpenedRef.current = true;
|
|
758
758
|
setOpen(true);
|
|
759
759
|
}
|
|
@@ -778,7 +778,8 @@ function BubbleWidget({
|
|
|
778
778
|
}, [open]);
|
|
779
779
|
const handleClose = () => {
|
|
780
780
|
setOpen(false);
|
|
781
|
-
|
|
781
|
+
const expires = Date.now() + 24 * 60 * 60 * 1e3;
|
|
782
|
+
localStorage.setItem("wallavi_bubble_dismissed", String(expires));
|
|
782
783
|
};
|
|
783
784
|
const toggleExpanded = () => setExpanded((v) => !v);
|
|
784
785
|
const isLeft = position === "bottom-left";
|
package/dist/index.mjs
CHANGED
|
@@ -726,8 +726,8 @@ function BubbleWidget({
|
|
|
726
726
|
const autoOpenedRef = useRef(false);
|
|
727
727
|
useEffect(() => {
|
|
728
728
|
if (!autoOpen || autoOpenedRef.current) return;
|
|
729
|
-
const
|
|
730
|
-
if (
|
|
729
|
+
const dismissedUntil = Number(localStorage.getItem("wallavi_bubble_dismissed") ?? 0);
|
|
730
|
+
if (dismissedUntil < Date.now()) {
|
|
731
731
|
autoOpenedRef.current = true;
|
|
732
732
|
setOpen(true);
|
|
733
733
|
}
|
|
@@ -752,7 +752,8 @@ function BubbleWidget({
|
|
|
752
752
|
}, [open]);
|
|
753
753
|
const handleClose = () => {
|
|
754
754
|
setOpen(false);
|
|
755
|
-
|
|
755
|
+
const expires = Date.now() + 24 * 60 * 60 * 1e3;
|
|
756
|
+
localStorage.setItem("wallavi_bubble_dismissed", String(expires));
|
|
756
757
|
};
|
|
757
758
|
const toggleExpanded = () => setExpanded((v) => !v);
|
|
758
759
|
const isLeft = position === "bottom-left";
|