diff options
| author | Dax Raad <[email protected]> | 2025-05-23 16:51:53 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-26 12:40:17 -0400 |
| commit | 5c491758f57b4e5eaf8d15f3bcd02f775ab3edad (patch) | |
| tree | 3f7df73c6d7e3ae39b1bef7ed145dd53712c137b /js/src/share | |
| parent | 5f750b7368226ce455a6848f5f744d43179198e5 (diff) | |
| download | opencode-5c491758f57b4e5eaf8d15f3bcd02f775ab3edad.tar.gz opencode-5c491758f57b4e5eaf8d15f3bcd02f775ab3edad.zip | |
sync
Diffstat (limited to 'js/src/share')
| -rw-r--r-- | js/src/share/share.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/js/src/share/share.ts b/js/src/share/share.ts index 6c0573e91..6191da684 100644 --- a/js/src/share/share.ts +++ b/js/src/share/share.ts @@ -2,8 +2,11 @@ import { App } from "../app"; import { Bus } from "../bus"; import { Session } from "../session/session"; import { Storage } from "../storage/storage"; +import { Log } from "../util/log"; export namespace Share { + const log = Log.create({ service: "share" }); + const state = App.state("share", async () => { Bus.subscribe(Storage.Event.Write, async (payload) => { const [root, ...splits] = payload.properties.key.split("/"); @@ -11,12 +14,6 @@ export namespace Share { const [type, sessionID] = splits; const session = await Session.get(sessionID); if (!session.shareID) return; - console.log({ - sessionID: sessionID, - shareID: session.shareID, - key: payload.properties.key, - content: payload.properties.content, - }); await fetch(`${URL}/share_sync`, { method: "POST", body: JSON.stringify({ @@ -25,7 +22,9 @@ export namespace Share { key: payload.properties.key, content: payload.properties.content, }), - }).then(console.log); + }) + .then((x) => x.text()) + .then(console.log); }); }); |
