play/pause button
This commit is contained in:
@@ -136,6 +136,14 @@ const handlers = {
|
||||
commit();
|
||||
},
|
||||
|
||||
// Broadcast without saving: `paused` is not part of the persisted state.
|
||||
setPaused(_ws, msg) {
|
||||
if (typeof msg.paused !== 'boolean') return;
|
||||
if (store.getState().paused === msg.paused) return;
|
||||
store.getState().paused = msg.paused;
|
||||
broadcastState();
|
||||
},
|
||||
|
||||
setBackground(_ws, msg) {
|
||||
if (!store.isBackground(msg.key)) return;
|
||||
store.getState().background = msg.key;
|
||||
|
||||
Reference in New Issue
Block a user