Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TodePond authored Dec 24, 2023
1 parent 3e06ddd commit f38416d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wikiblogarden/tadi-web/fame/facts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,14 @@ I can edit the heroes, push a button to upload those changes.
<script>
window.handlePushHeroes = async () => {
const newHeroes = JSON.parse(heroesInput.value)
const result = await val("todepond.setHeroes", newHeroes, heroes, passwordInput.value)
const oldHeroes = heroes
const password = passwordInput.value
const result = await val("todepond.setHeroes", newHeroes, oldHeroes, password)
if (result.success) {
heroes = newHeroes
}
}
</script>
```
This time, we have to send a `password` along too. We also send along a copy of what **we think** the current heroes are. It lets the server check if you're up-to-date. If you're out-of-date, you might be overriding newer data, so it rejects it.

0 comments on commit f38416d

Please sign in to comment.