mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 20:21:38 +00:00
Simplify popup handling
This commit is contained in:
parent
de33cf0e55
commit
d158ccb2eb
1 changed files with 5 additions and 12 deletions
|
|
@ -213,10 +213,7 @@ function App:requestPermission(source: string, name: string, apis: {string}, ini
|
||||||
|
|
||||||
self:setState(function(state)
|
self:setState(function(state)
|
||||||
state.popups[source] = {
|
state.popups[source] = {
|
||||||
responseEvent = responseEvent,
|
|
||||||
initialState = initialState,
|
|
||||||
name = name,
|
name = name,
|
||||||
apis = apis,
|
|
||||||
content = e(PermissionPopup, {
|
content = e(PermissionPopup, {
|
||||||
responseEvent = responseEvent,
|
responseEvent = responseEvent,
|
||||||
initialState = initialState,
|
initialState = initialState,
|
||||||
|
|
@ -226,6 +223,10 @@ function App:requestPermission(source: string, name: string, apis: {string}, ini
|
||||||
apiDescriptions = self.headlessAPI._apiDescriptions,
|
apiDescriptions = self.headlessAPI._apiDescriptions,
|
||||||
transparency = Roact.createBinding(0),
|
transparency = Roact.createBinding(0),
|
||||||
}),
|
}),
|
||||||
|
onClose = function()
|
||||||
|
responseEvent:Fire(initialState)
|
||||||
|
responseEvent:Destroy()
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
end)
|
end)
|
||||||
|
|
@ -418,15 +419,7 @@ function App:render()
|
||||||
|
|
||||||
zIndexBehavior = Enum.ZIndexBehavior.Sibling,
|
zIndexBehavior = Enum.ZIndexBehavior.Sibling,
|
||||||
|
|
||||||
onClose = function()
|
onClose = popup.onClose,
|
||||||
popup.responseEvent:Fire(popup.initialState)
|
|
||||||
popup.responseEvent:Destroy()
|
|
||||||
|
|
||||||
self:setState(function(state)
|
|
||||||
state.popups[id] = nil
|
|
||||||
return state
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
}, {
|
}, {
|
||||||
Content = popup.content,
|
Content = popup.content,
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue