feat: open Jira in named window on start and speaker change
This commit is contained in:
@@ -24,6 +24,7 @@ type App struct {
|
||||
session *models.MeetingSession
|
||||
currentLogs map[uint]*models.ParticipantLog
|
||||
participantURLs map[uint]string
|
||||
jiraBaseURL string
|
||||
updater *updater.Updater
|
||||
}
|
||||
|
||||
@@ -191,6 +192,7 @@ func (a *App) StartMeeting(participantOrder []uint, attendance map[uint]bool) er
|
||||
jiraURL = settings.DefaultJiraUrl
|
||||
}
|
||||
|
||||
a.jiraBaseURL = jiraURL
|
||||
a.participantURLs = make(map[uint]string)
|
||||
if jiraURL != "" {
|
||||
for _, p := range participants {
|
||||
@@ -202,6 +204,10 @@ func (a *App) StartMeeting(participantOrder []uint, attendance map[uint]bool) er
|
||||
}
|
||||
}
|
||||
|
||||
if jiraURL != "" {
|
||||
runtime.EventsEmit(a.ctx, "jira:open", jiraURL)
|
||||
}
|
||||
|
||||
a.timer = timer.New(meeting.TimeLimit, warningThreshold)
|
||||
a.timer.SetQueue(queue)
|
||||
a.currentLogs = make(map[uint]*models.ParticipantLog)
|
||||
@@ -227,7 +233,9 @@ func (a *App) handleTimerEvents() {
|
||||
case timer.EventSpeakerChanged:
|
||||
a.saveSpeakerLog(event.State)
|
||||
if url, ok := a.participantURLs[event.State.CurrentSpeakerID]; ok && url != "" {
|
||||
runtime.BrowserOpenURL(a.ctx, url)
|
||||
runtime.EventsEmit(a.ctx, "jira:open", url)
|
||||
} else if a.jiraBaseURL != "" {
|
||||
runtime.EventsEmit(a.ctx, "jira:open", a.jiraBaseURL)
|
||||
}
|
||||
runtime.EventsEmit(a.ctx, "timer:speaker_changed", event.State)
|
||||
case timer.EventMeetingEnded:
|
||||
|
||||
Reference in New Issue
Block a user