Update chat example code

This commit is contained in:
Tony Garnock-Jones 2024-04-12 10:25:04 +02:00
parent 96a8367667
commit 4cce2fb6f2
2 changed files with 5 additions and 8 deletions

View File

@ -16,13 +16,13 @@
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>", "author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
"license": "GPL-3.0+", "license": "GPL-3.0+",
"dependencies": { "dependencies": {
"@preserves/core": "0.995", "@preserves/core": "0.995.200",
"@syndicate-lang/core": "*", "@syndicate-lang/core": "*",
"@syndicate-lang/html": "*", "@syndicate-lang/html": "*",
"@syndicate-lang/ws-relay": "*" "@syndicate-lang/ws-relay": "*"
}, },
"devDependencies": { "devDependencies": {
"@preserves/schema-cli": "0.995", "@preserves/schema-cli": "0.995.201",
"@syndicate-lang/ts-plugin": "*", "@syndicate-lang/ts-plugin": "*",
"@syndicate-lang/tsc": "*", "@syndicate-lang/tsc": "*",
"rollup": "^2.60", "rollup": "^2.60",

View File

@ -1,7 +1,7 @@
/// SPDX-License-Identifier: GPL-3.0-or-later /// SPDX-License-Identifier: GPL-3.0-or-later
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com> /// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
import { fromJS, Bytes, Dataspace, Ref, Sturdy, AnyValue, Reader, Schemas, Embedded, stringify } from "@syndicate-lang/core"; import { fromJS, Bytes, Dataspace, Ref, Sturdy, AnyValue, Reader, Schemas, stringify } from "@syndicate-lang/core";
import { boot as bootHtml, Anchor, template as html, HtmlFragments, GlobalEvent, UIAttribute, UIChangeableProperty } from "@syndicate-lang/html"; import { boot as bootHtml, Anchor, template as html, HtmlFragments, GlobalEvent, UIAttribute, UIChangeableProperty } from "@syndicate-lang/html";
import { boot as bootWakeDetector, WakeEvent } from "./wake-detector"; import { boot as bootWakeDetector, WakeEvent } from "./wake-detector";
import { boot as bootWsRelay } from "@syndicate-lang/ws-relay"; import { boot as bootWsRelay } from "@syndicate-lang/ws-relay";
@ -46,12 +46,9 @@ function bootChat(ds: Ref) {
during G.ResolvePath({ during G.ResolvePath({
"route": route, "route": route,
"addr": $addr, "addr": $addr,
"control": $control_e: Embedded, "control": $control: Ref,
"resolved": G.Resolved.accepted($remoteDs_e: Embedded), "resolved": G.Resolved.accepted($remoteDs: Ref),
}) => { }) => {
const remoteDs = remoteDs_e.embeddedValue;
const control = control_e.embeddedValue;
on message WakeEvent() => at control { on message WakeEvent() => at control {
send message G.ForceDisconnect(); send message G.ForceDisconnect();
} }