@4i/modal-manager 1.1.32 → 1.1.33
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
@@ -127,6 +127,7 @@ var ModalProvider = function (_a) {
|
|
127
127
|
return __generator(this, function (_a) {
|
128
128
|
switch (_a.label) {
|
129
129
|
case 0:
|
130
|
+
console.log("handleClose", position);
|
130
131
|
if (!(position === "all")) return [3 /*break*/, 5];
|
131
132
|
i = modals.length - 1;
|
132
133
|
_a.label = 1;
|
@@ -144,7 +145,7 @@ var ModalProvider = function (_a) {
|
|
144
145
|
return [2 /*return*/];
|
145
146
|
case 5:
|
146
147
|
indexToRemove = position;
|
147
|
-
if (
|
148
|
+
if (typeof indexToRemove !== "number" ||
|
148
149
|
indexToRemove < 0 ||
|
149
150
|
indexToRemove >= modals.length) {
|
150
151
|
// Если индекс невалидный, закрываем последний
|
@@ -81,6 +81,7 @@ const ModalProvider: React.FC<ModalProviderProps> = ({
|
|
81
81
|
};
|
82
82
|
|
83
83
|
const handleClose = async (position: number | string) => {
|
84
|
+
console.log("handleClose", position);
|
84
85
|
if (position === "all") {
|
85
86
|
// Закрыть все модальные окна с анимацией
|
86
87
|
for (let i = modals.length - 1; i >= 0; i--) {
|
@@ -91,10 +92,10 @@ const ModalProvider: React.FC<ModalProviderProps> = ({
|
|
91
92
|
}
|
92
93
|
|
93
94
|
// Обработка числовых позиций
|
94
|
-
let indexToRemove: number
|
95
|
+
let indexToRemove: number = position as number;
|
95
96
|
|
96
97
|
if (
|
97
|
-
|
98
|
+
typeof indexToRemove !== "number" ||
|
98
99
|
indexToRemove < 0 ||
|
99
100
|
indexToRemove >= modals.length
|
100
101
|
) {
|