Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Feb 28, 2024
1 parent d70e4ed commit 5c1f720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/client/class/draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import {

import * as assert from '@/assert.js'
import * as schema from '@/schema/index.js'
import { sha256 } from '@cmdcode/crypto-tools/hash'

export class DraftSession extends EventEmitter <{
'approve' : string
Expand Down Expand Up @@ -576,8 +577,9 @@ export class DraftSession extends EventEmitter <{
const updated_at = e.created_at
const store_id = e.id
try {
const session_id = socket.recover(e)
sessions.push({ pubkey, session_id, store_id, updated_at })
const secret = socket.recover(e)
const id = sha256(secret).hex
sessions.push({ pubkey, id, secret, store_id, updated_at })
} catch { return }
})
return sessions
Expand Down
3 changes: 2 additions & 1 deletion src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export type EventFilter = {

export interface DraftItem {
pubkey : string,
session_id : string,
id : string,
secret : string,
store_id : string,
updated_at : number
}
Expand Down

0 comments on commit 5c1f720

Please sign in to comment.