Skip to content

Commit

Permalink
Merge pull request pioneerspacesim#4710 from vakhoir/bugfix/mission_h…
Browse files Browse the repository at this point in the history
…angup_ui

Hang up chat on visibility change
  • Loading branch information
fluffyfreak authored Oct 18, 2019
2 parents 7fffa47 + c4b2b37 commit de9f284
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions data/ui/StationView/BulletinBoard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ local bbTable = ui:Table()

local bbSearchField = ui:TextEntry()
local searchText = "";
local chatForm;

bbTable.onVisibilityChanged:Connect(function (visible)
if (chatForm and not visible) then
chatForm:Close()
chatForm = nil
end
end)

bbTable.onRowClicked:Connect(function (row)
local station = Game.player:GetDockedWith()
Expand All @@ -40,8 +48,8 @@ bbTable.onRowClicked:Connect(function (row)
station:UnlockAdvert(ref)
end

local form = ChatForm.New(chatFunc, removeFunc, closeFunc, ref, tabGroup)
ui:NewLayer(form:BuildWidget())
chatForm = ChatForm.New(chatFunc, removeFunc, closeFunc, ref, tabGroup)
ui:NewLayer(chatForm:BuildWidget())
end)

local updateTable = function (station)
Expand Down

0 comments on commit de9f284

Please sign in to comment.