I’d recommend doing a CVar toggle rather than manually hiding/showing the toasts.
/run local k,v = "showToastWindow" v = C_CVar.GetCVar(k) C_CVar.SetCVar(k, 1 - v) print(k .. (v == "1" and " Disabled" or " Enabled"))
[added]
If you just want to expand on what you’ve got you’ll want either :IsShown()
or :IsVisible()
for your test. I’m not sure which one is appropriate for this case.
https://wowpedia.fandom.com/wiki/API_ScriptRegion_IsShown
/run if QuickJoinToastButton:IsVisible() then QuickJoinToastButton:Hide() else QuickJoinToastButton:Show() end