@volter/teams 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/viewer/viewer.mjs CHANGED
@@ -42,8 +42,8 @@ async function main() {
42
42
  const claims = claimsOf(token);
43
43
  // A session token (a Room's session-backed Conversation) names one team session, not a surface.
44
44
  if (claims.session?.id) {
45
- $('target').textContent = `session · ${claims.session.id}`;
46
- $('scope').textContent = claims.scope === 'control' ? 'control' : 'view only';
45
+ // The session view's own header names the session and carries the one scope badge.
46
+ document.querySelector('body > header').hidden = true;
47
47
  await showSession(claims.session, claims.scope === 'control');
48
48
  ask('viewer-ready');
49
49
  return;
@@ -73,6 +73,7 @@ async function showSession(session, control) {
73
73
  const element = $('session');
74
74
  element.hidden = false;
75
75
  const view = mountSessionView(element, {
76
+ control,
76
77
  onSend: async (text) => {
77
78
  view.update({ sending: true });
78
79
  try {
@@ -84,9 +85,8 @@ async function showSession(session, control) {
84
85
  } catch (error) { status(`Not delivered: ${error.message}`); } finally { view.update({ sending: false }); }
85
86
  },
86
87
  });
87
- view.update({ canSend: control });
88
88
  const headers = async () => ({ Authorization: `Bearer ${await freshToken()}` });
89
- const apply = (body) => view.update({ descriptor: body.descriptor, messages: body.messages.map((message) => message.value), status: 'ready', error: null });
89
+ const apply = (body) => view.update({ descriptor: body.descriptor, messages: body.messages.map((message) => message.value), members: body.names?.members ?? [], machines: body.names?.machines ?? [], status: 'ready', error: null });
90
90
  let reading = null;
91
91
  const read = () => (reading ??= (async () => {
92
92
  try {