feat(editor) : notify peers of draft overwrite
This commit is contained in:
@@ -208,8 +208,8 @@ export function GuideOverviewForm({
|
||||
value,
|
||||
valid: Boolean(cover.id && overview.trim() && !invalidYoutubeLinks),
|
||||
initialVersion: guide.version,
|
||||
persist: (next, expectedVersion) =>
|
||||
saveGuideOverview(guide.id, { ...next, expectedVersion }),
|
||||
persist: (next, expectedVersion, intent) =>
|
||||
saveGuideOverview(guide.id, { ...next, expectedVersion }, intent),
|
||||
storageKey: adminDraftKey(guide.id, "overview"),
|
||||
localDraft,
|
||||
parseLocalDraft: (candidate) => {
|
||||
|
||||
@@ -1380,8 +1380,8 @@ function WeaponEditor({ guide, weapons, characters, initial }: EditorBase) {
|
||||
value,
|
||||
valid: validation.success,
|
||||
initialVersion: guide.version,
|
||||
persist: (next, expectedVersion) =>
|
||||
saveWeaponSection(guide.id, { ...next, expectedVersion }),
|
||||
persist: (next, expectedVersion, intent) =>
|
||||
saveWeaponSection(guide.id, { ...next, expectedVersion }, intent),
|
||||
storageKey: adminDraftKey(guide.id, "weapon"),
|
||||
localDraft,
|
||||
parseLocalDraft: (candidate) =>
|
||||
@@ -1885,8 +1885,8 @@ function ArtifactEditor({
|
||||
value,
|
||||
valid: validation.success,
|
||||
initialVersion: guide.version,
|
||||
persist: (next, expectedVersion) =>
|
||||
saveArtifactSection(guide.id, { ...next, expectedVersion }),
|
||||
persist: (next, expectedVersion, intent) =>
|
||||
saveArtifactSection(guide.id, { ...next, expectedVersion }, intent),
|
||||
storageKey: adminDraftKey(guide.id, "artifact"),
|
||||
localDraft,
|
||||
parseLocalDraft: (candidate) =>
|
||||
@@ -2588,8 +2588,8 @@ function ConstellationEditor({
|
||||
value,
|
||||
valid: validation.success,
|
||||
initialVersion: guide.version,
|
||||
persist: (next, expectedVersion) =>
|
||||
saveConstellationSection(guide.id, { ...next, expectedVersion }),
|
||||
persist: (next, expectedVersion, intent) =>
|
||||
saveConstellationSection(guide.id, { ...next, expectedVersion }, intent),
|
||||
storageKey: adminDraftKey(guide.id, "constellations"),
|
||||
localDraft,
|
||||
parseLocalDraft: (candidate) =>
|
||||
@@ -3034,8 +3034,8 @@ function TeamEditor({
|
||||
value,
|
||||
valid: validation.success,
|
||||
initialVersion: guide.version,
|
||||
persist: (next, expectedVersion) =>
|
||||
saveTeamSection(guide.id, { ...next, expectedVersion }),
|
||||
persist: (next, expectedVersion, intent) =>
|
||||
saveTeamSection(guide.id, { ...next, expectedVersion }, intent),
|
||||
storageKey: adminDraftKey(guide.id, "team"),
|
||||
localDraft,
|
||||
parseLocalDraft: (candidate) =>
|
||||
@@ -4477,11 +4477,11 @@ function ExtraEditor({ guide, extraSectionId, initial, characters, weapons, arti
|
||||
value,
|
||||
valid: validation.success,
|
||||
initialVersion: guide.version,
|
||||
persist: (next, expectedVersion) =>
|
||||
persist: (next, expectedVersion, intent) =>
|
||||
saveGuideExtra(guide.id, sectionId, {
|
||||
section: next.sections[0],
|
||||
expectedVersion,
|
||||
}),
|
||||
}, intent),
|
||||
storageKey: adminDraftKey(guide.id, `extra:${sectionId}`),
|
||||
localDraft,
|
||||
parseLocalDraft: (candidate) =>
|
||||
|
||||
Reference in New Issue
Block a user