feat: open Jira in named window on start and speaker change
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
EventsOn('timer:meeting_warning', handleMeetingWarning)
|
||||
EventsOn('timer:meeting_ended', handleMeetingEnded)
|
||||
EventsOn('timer:speaker_changed', handleSpeakerChanged)
|
||||
EventsOn('jira:open', handleJiraOpen)
|
||||
|
||||
// Warm up AudioContext on first user interaction
|
||||
const warmUpAudio = async () => {
|
||||
@@ -96,6 +97,7 @@
|
||||
EventsOff('timer:meeting_warning')
|
||||
EventsOff('timer:meeting_ended')
|
||||
EventsOff('timer:speaker_changed')
|
||||
EventsOff('jira:open')
|
||||
})
|
||||
|
||||
function handleTimerEvent(state) {
|
||||
@@ -132,6 +134,10 @@
|
||||
timerState = state
|
||||
}
|
||||
|
||||
function handleJiraOpen(url) {
|
||||
window.open(url, 'jira-kanban')
|
||||
}
|
||||
|
||||
let audioContext = null
|
||||
|
||||
function getAudioContext() {
|
||||
|
||||
@@ -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