Skip to content

Commit

Permalink
Fix: present the existing app/window on subsequent instances
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed May 3, 2023
1 parent 623b42e commit c0feda7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/application.cr
@@ -1,18 +1,21 @@
module BriumApp
# TODO: when access token isn't defined, present a window to request and
# enter the access token, then close it and present the talk UI.

class Application < Gtk::Application
@messages = [] of Message
@window : Window?
@activated = false

def initialize
super application_id: "me.brium.app"

on_activate do
window.build
window.connect("destroy") { quit }
window.chat_entry.on_activate { handle_chat_message }
if @activated
window.present_with_time(Time.utc.to_unix)
else
@activated = true
window.build
window.connect("destroy") { quit }
window.chat_entry.on_activate { handle_chat_message }
end
end
end

Expand Down

0 comments on commit c0feda7

Please sign in to comment.