Fix broken Notify return and redundant checks
Clean up modules/notify/solaire_notify/client.lua by removing duplicated conditional lines in the resource check and fixing Notify.SendNotify to return a single table argument to exports.solaire_notify:Notify. This removes stray/duplicated lines that caused syntax/logic issues and simplifies the early-return config logic.
This commit is contained in:
1 parent
aa0b1e17f6
commit
d2b6c288f1
1 file changed
-8
@@ -4,10 +4,6 @@ local resourceName = "solaire_notify"
|
|||||||
local configValue = BridgeSharedConfig.Notify
|
local configValue = BridgeSharedConfig.Notify
|
||||||
|
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
or (configValue ~= "auto" and configValue ~= resourceName)
|
|
||||||
then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
Notify.GetResourceName = function()
|
Notify.GetResourceName = function()
|
||||||
return resourceName
|
return resourceName
|
||||||
@@ -21,10 +17,6 @@ Notify.SendNotify = function(message, _type, time)
|
|||||||
time = time or 3000
|
time = time or 3000
|
||||||
|
|
||||||
return exports.solaire_notify:Notify({ type = _type or "info", message = message, duration = time })
|
return exports.solaire_notify:Notify({ type = _type or "info", message = message, duration = time })
|
||||||
type = _type or "info",
|
|
||||||
message = message,
|
|
||||||
duration = time,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will send a notify message of the type and time passed
|
---This will send a notify message of the type and time passed
|
||||||
|
|||||||
Reference in new issue
Block a user