mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-27 07:22:50 -05:00
Add reload button to control interface
This commit is contained in:
@@ -175,6 +175,17 @@ export default class StreamWindow extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
reloadView(viewIdx) {
|
||||
const view = this.views.find(
|
||||
(v) =>
|
||||
v.state.matches('displaying') &&
|
||||
v.state.context.pos.spaces.includes(viewIdx),
|
||||
)
|
||||
if (view) {
|
||||
view.send('RELOAD')
|
||||
}
|
||||
}
|
||||
|
||||
send(...args) {
|
||||
this.overlayView.webContents.send(...args)
|
||||
}
|
||||
|
||||
@@ -60,6 +60,8 @@ async function main() {
|
||||
streamWindow.setViews(new Map(msg.views))
|
||||
} else if (msg.type === 'set-listening-view') {
|
||||
streamWindow.setListeningView(msg.viewIdx)
|
||||
} else if (msg.type === 'reload-view') {
|
||||
streamWindow.reloadView(msg.viewIdx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,14 +16,11 @@ const viewStateMachine = Machine(
|
||||
},
|
||||
states: {
|
||||
empty: {
|
||||
entry: [
|
||||
assign({
|
||||
pos: {},
|
||||
info: {},
|
||||
url: null,
|
||||
}),
|
||||
'hideView',
|
||||
],
|
||||
entry: assign({
|
||||
pos: {},
|
||||
info: {},
|
||||
url: null,
|
||||
}),
|
||||
invoke: {
|
||||
src: 'clearView',
|
||||
onError: {
|
||||
@@ -45,6 +42,7 @@ const viewStateMachine = Machine(
|
||||
}),
|
||||
cond: 'urlUnchanged',
|
||||
},
|
||||
RELOAD: '.loading',
|
||||
},
|
||||
states: {
|
||||
loading: {
|
||||
@@ -80,6 +78,7 @@ const viewStateMachine = Machine(
|
||||
running: {
|
||||
initial: 'muted',
|
||||
entry: 'positionView',
|
||||
exit: 'hideView',
|
||||
on: {
|
||||
DISPLAY: {
|
||||
actions: [
|
||||
|
||||
Reference in New Issue
Block a user