Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Dec 23, 2023
1 parent 9045cfe commit 45043a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prosemirror-versions/prosemirror-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ const unrenderVersion = editorview => {
* @param {Version} version
* @param {Version|null} prevSnapshot
*/
const versionTemplate = (editorview, version, prevSnapshot) => html`<div class="version-list" @click=${e => renderVersion(editorview, version, prevSnapshot)}>${new Date(version.date).toLocaleString()}</div>`
const versionTemplate = (editorview, version, prevSnapshot) => html`<div class="version-list" @click=${() => renderVersion(editorview, version, prevSnapshot)}>${new Date(version.date).toLocaleString()}</div>`

const versionList = (editorview, doc) => {
const versions = doc.getArray('versions')
return html`<div>${versions.length > 0 ? versions.map((version, i) => versionTemplate(editorview, version, i > 0 ? versions.get(i - 1).snapshot : null)) : html`<div>No snapshots..</div>`}</div>`
}

const snapshotButton = doc => {
return html`<button @click=${(e) => addVersion(doc)}>Snapshot</button>`
return html`<button @click=${() => addVersion(doc)}>Snapshot</button>`
}

/**
Expand All @@ -94,7 +94,7 @@ export const attachVersion = (parent, doc, editorview) => {
render(html`<div class="version-modal" ?hidden=${open}>${snapshotButton(doc)}${versionList(editorview, doc)}</div>`, vContainer)
}
updateLiveTrackingState(editorview)
liveTracking.addEventListener('click', e => {
liveTracking.addEventListener('click', () => {
if (liveTracking.checked) {
const versions = doc.getArray('versions')
const lastVersion = versions.length > 0 ? Y.decodeSnapshot(versions.get(versions.length - 1).snapshot) : Y.emptySnapshot
Expand Down

0 comments on commit 45043a5

Please sign in to comment.