aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-22 12:19:21 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-22 12:19:21 -0400
commit3a8f534a9bea20cedbb194d3cc9dceff6afcef37 (patch)
tree2cd95859a80260c42a45c4da5080f54f84be5bef /src/client/views/MainView.tsx
parente4afbe3da9375fa3a615a38de24874505340683d (diff)
added a way to broadcast a message to all users (e.g., for restarting server)
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index fcaa349cd..d6c46e3b0 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -80,6 +80,11 @@ export class MainView extends React.Component {
componentDidMount() {
const tag = document.createElement('script');
+ const proto = DocServer.GetRefField("rtfProto").then(proto => {
+ (proto instanceof Doc) && reaction(() => StrCast(proto.BROADCAST_MESSAGE),
+ msg => msg && alert(msg));
+ });
+
tag.src = "https://www.youtube.com/iframe_api";
const firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode!.insertBefore(tag, firstScriptTag);