Skip to content

Commit

Permalink
say hello when you get here
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Oct 3, 2024
1 parent 4a48c05 commit 86e31e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions public/automerge/collab.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ export async function start(url, memtree) {
)
firstLoadComplete = true
})
handle.broadcast("hello")
/**
*
* @param {AutomergeRepo.DocHandleEphemeralMessagePayload<CollaborativePattern>} payload
*/
function onephemera(payload) {
console.info(payload.message, payload)
}
handle.addListener("ephemeral-message", onephemera)
alreadyFancy = true
let preventPatchApplications = false
let dispose = memtree.listen((kind, index, source) => {
Expand Down Expand Up @@ -413,6 +422,7 @@ export async function start(url, memtree) {
unlisten = () => {
dispose()
handle.off("change", onchange)
handle.off("ephemeral-message", onephemera)
offsoundchanges.forEach(o => o())
}
}
Expand Down
2 changes: 1 addition & 1 deletion public/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="@secret-types/serviceworker" />
// update this when changing the service worker
const SERVICE_WORKER_VERSION = "v21"
const SERVICE_WORKER_VERSION = "v22"

const addResourcesToCache = async resources => {
const cache = await caches.open(SERVICE_WORKER_VERSION)
Expand Down

0 comments on commit 86e31e9

Please sign in to comment.