|
|
@@ -351,6 +351,23 @@ function createGlobalSync() {
|
|
|
bootstrapInstance(directory)
|
|
|
break
|
|
|
}
|
|
|
+ case "session.created": {
|
|
|
+ const result = Binary.search(store.session, event.properties.info.id, (s) => s.id)
|
|
|
+ if (result.found) {
|
|
|
+ setStore("session", result.index, reconcile(event.properties.info))
|
|
|
+ break
|
|
|
+ }
|
|
|
+ setStore(
|
|
|
+ "session",
|
|
|
+ produce((draft) => {
|
|
|
+ draft.splice(result.index, 0, event.properties.info)
|
|
|
+ }),
|
|
|
+ )
|
|
|
+ if (!event.properties.info.parentID) {
|
|
|
+ setStore("sessionTotal", store.sessionTotal + 1)
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
case "session.updated": {
|
|
|
const result = Binary.search(store.session, event.properties.info.id, (s) => s.id)
|
|
|
if (event.properties.info.time.archived) {
|