ikualo-ui-kit-mobile 2.0.7 → 2.0.8

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/app.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "ikualo-app-2.0",
4
4
  "slug": "ikualo-app-20",
5
5
  "owner": "ikualo",
6
- "version": "2.0.7",
6
+ "version": "2.0.8",
7
7
  "orientation": "portrait",
8
8
  "icon": "./assets/icon.png",
9
9
  "userInterfaceStyle": "automatic",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ikualo-ui-kit-mobile",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "start": "expo start",
@@ -34,10 +34,18 @@ class DialogManager {
34
34
  }
35
35
 
36
36
  addDialog(dialog: DialogQueueItem) {
37
- // Solo cerrar el diálogo actual si el nuevo tiene prioridad explícita (1-5)
38
- // y es mayor que la prioridad del diálogo actual
39
- if (this.currentDialog && dialog.priority > 0 && dialog.priority > this.currentDialog.priority) {
40
- this.closeCurrentDialog();
37
+ // Lógica de cierre del diálogo actual:
38
+ // 1. Si el nuevo NO tiene prioridad (0): cierra si el anterior tampoco tiene prioridad
39
+ // 2. Si el nuevo tiene prioridad (1-5): cierra si el anterior no tiene prioridad O si tiene prioridad menor o igual
40
+ if (this.currentDialog) {
41
+ const shouldCloseCurrent =
42
+ (dialog.priority === 0 && this.currentDialog.priority === 0) || // Ambos sin prioridad: cierra el anterior
43
+ (dialog.priority > 0 && this.currentDialog.priority === 0) || // Nuevo con prioridad, anterior sin: cierra
44
+ (dialog.priority > 0 && dialog.priority >= this.currentDialog.priority); // Ambos con prioridad: si nueva es mayor o igual
45
+
46
+ if (shouldCloseCurrent) {
47
+ this.closeCurrentDialog();
48
+ }
41
49
  }
42
50
 
43
51
  // Agregar a la cola
@@ -181,9 +189,11 @@ export const DialogDown = (props: IDialogDown & { priority?: 0 | 1 | 2 | 3 | 4 |
181
189
  title,
182
190
  dialogId,
183
191
  currentDialogId: currentDialog?.id,
192
+ currentPriority: currentDialog?.priority,
193
+ newPriority: priority,
184
194
  isCurrentDialog,
185
195
  isVisible,
186
- priority,
196
+ shouldShow: isCurrentDialog && isVisible,
187
197
  });
188
198
 
189
199
  return (