mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 13:21:38 +00:00
Return dismiss function from Notify
This commit is contained in:
parent
5c0e1d0ec4
commit
91cba1b0e9
1 changed files with 3 additions and 4 deletions
|
|
@ -302,13 +302,13 @@ function API.new(app)
|
||||||
end
|
end
|
||||||
|
|
||||||
Rojo._apiDescriptions.Notify = "Shows a notification in the Rojo UI"
|
Rojo._apiDescriptions.Notify = "Shows a notification in the Rojo UI"
|
||||||
function Rojo:Notify(msg: string, timeout: number?, actions: { [string]: {text: string, style: string, layoutOrder: number, onClick: (any) -> ()} }?)
|
function Rojo:Notify(msg: string, timeout: number?, actions: { [string]: {text: string, style: string, layoutOrder: number, onClick: (any) -> ()} }?): () -> ()
|
||||||
assert(type(msg) == "string", "Message must be type `string`")
|
assert(type(msg) == "string", "Message must be type `string`")
|
||||||
assert(type(timeout) == "number" or timeout == nil, "Timeout must be type `number?`")
|
assert(type(timeout) == "number" or timeout == nil, "Timeout must be type `number?`")
|
||||||
assert((actions == nil) or (type(actions) == "table"), "Actions must be table or nil")
|
assert((actions == nil) or (type(actions) == "table"), "Actions must be table or nil")
|
||||||
|
|
||||||
if Rojo:_checkRateLimit("Notify") then
|
if Rojo:_checkRateLimit("Notify") then
|
||||||
return
|
return function() end
|
||||||
end
|
end
|
||||||
|
|
||||||
local sanitizedActions = nil
|
local sanitizedActions = nil
|
||||||
|
|
@ -333,8 +333,7 @@ function API.new(app)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
app:addThirdPartyNotification(Rojo:_getCallerName(), msg, timeout, sanitizedActions)
|
return app:addThirdPartyNotification(Rojo:_getCallerName(), msg, timeout, sanitizedActions)
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Rojo._apiDescriptions.GetHostAndPort = "Gets the host and port that Rojo is set to"
|
Rojo._apiDescriptions.GetHostAndPort = "Gets the host and port that Rojo is set to"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue