@@ -12,15 +12,19 @@ const MODAL_OPEN_CLASS_NAME = 'modal-open'
12
12
13
13
export const useSharedModalStack = createSharedComposable ( ( ) => {
14
14
const registry : Ref < ComponentInternalInstance [ ] > = ref ( [ ] )
15
- const stack : Ref < ComponentInternalInstance [ ] > = ref ( [ ] )
15
+ const stack : Ref < ComponentInternalInstance [ ] > = ref ( [ ] )
16
16
const count = computed ( ( ) => stack . value . length )
17
17
const last = computed ( ( ) => stack . value [ stack . value . length - 1 ] )
18
- const push = ( modal : ComponentInternalInstance ) => stack . value . push ( modal )
19
- const pop = ( ) => stack . value . pop ( )
18
+ const push = ( modal : ComponentInternalInstance ) => {
19
+ stack . value . push ( modal )
20
+ }
21
+ const pop = ( ) => {
22
+ stack . value . pop ( )
23
+ }
20
24
const remove = ( modal : ComponentInternalInstance ) : void => {
21
25
stack . value = stack . value . filter ( ( item ) => item . uid !== modal . uid )
22
26
}
23
- const find = ( id : string ) => registry . value . find ( ( modal ) => modal . exposed ! . id === id ) || null
27
+ const find = ( id : string ) => registry . value . find ( ( modal ) => modal . exposed ? .id === id ) || null
24
28
25
29
const updateHTMLAttrs = getSSRHandler ( 'updateHTMLAttrs' , ( selector , attribute , value ) => {
26
30
const el =
@@ -48,7 +52,7 @@ export const useSharedModalStack = createSharedComposable(() => {
48
52
} )
49
53
50
54
export default ( modalOpen : Ref < boolean > ) : void => {
51
- const { registry, push, remove, stack } = useSharedModalStack ( )
55
+ const { registry, push, remove} = useSharedModalStack ( )
52
56
53
57
const currentModal = getCurrentInstance ( )
54
58
0 commit comments