This commit is contained in:
@@ -281,7 +281,7 @@ export const SessionRoutes = lazy(() =>
|
|||||||
session.title = updates.title
|
session.title = updates.title
|
||||||
}
|
}
|
||||||
if (updates.time?.archived !== undefined) session.time.archived = updates.time.archived
|
if (updates.time?.archived !== undefined) session.time.archived = updates.time.archived
|
||||||
})
|
}, { touch: false })
|
||||||
|
|
||||||
return c.json(updatedSession)
|
return c.json(updatedSession)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ export namespace Session {
|
|||||||
draft.share = {
|
draft.share = {
|
||||||
url: share.url,
|
url: share.url,
|
||||||
}
|
}
|
||||||
})
|
}, { touch: false })
|
||||||
return share
|
return share
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -269,14 +269,16 @@ export namespace Session {
|
|||||||
await ShareNext.remove(id)
|
await ShareNext.remove(id)
|
||||||
await update(id, (draft) => {
|
await update(id, (draft) => {
|
||||||
draft.share = undefined
|
draft.share = undefined
|
||||||
})
|
}, { touch: false })
|
||||||
})
|
})
|
||||||
|
|
||||||
export async function update(id: string, editor: (session: Info) => void) {
|
export async function update(id: string, editor: (session: Info) => void, options?: { touch?: boolean }) {
|
||||||
const project = Instance.project
|
const project = Instance.project
|
||||||
const result = await Storage.update<Info>(["session", project.id, id], (draft) => {
|
const result = await Storage.update<Info>(["session", project.id, id], (draft) => {
|
||||||
editor(draft)
|
editor(draft)
|
||||||
draft.time.updated = Date.now()
|
if (options?.touch !== false) {
|
||||||
|
draft.time.updated = Date.now()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
Bus.publish(Event.Updated, {
|
Bus.publish(Event.Updated, {
|
||||||
info: result,
|
info: result,
|
||||||
|
|||||||
@@ -1816,6 +1816,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
|||||||
|
|
||||||
const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
|
const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
|
||||||
draft.title = title
|
draft.title = title
|
||||||
})
|
}, { touch: false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user