You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `cancel` button in AlertDialog now rejects the promise instead of resolving with `'cancel'` status, aligning it with the dismiss (Escape key) behavior.
10
+
11
+
**Migration Guide:**
12
+
13
+
**Before:**
14
+
15
+
```typescript
16
+
alertDialogAPI.open({...})
17
+
.then((status) => {
18
+
if (status==='cancel') {
19
+
// Handle cancel
20
+
} elseif (status==='confirm') {
21
+
// Handle confirm
22
+
}
23
+
})
24
+
```
25
+
26
+
**After:**
27
+
28
+
```typescript
29
+
alertDialogAPI.open({...})
30
+
.then((status) => {
31
+
if (status==='confirm') {
32
+
// Handle confirm
33
+
} elseif (status==='secondary') {
34
+
// Handle secondary action
35
+
}
36
+
})
37
+
.catch(() => {
38
+
// Handle cancel or dismiss
39
+
})
40
+
```
41
+
42
+
**Note:**`AlertDialogResolveStatus` type no longer includes `'cancel'` - it now only contains `'confirm' | 'secondary'`.
0 commit comments