Skip to content

Commit

Permalink
variable renames
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Aug 12, 2024
1 parent b304025 commit 61e4655
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions frontend/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ patch: ${JSON.stringify(
}
}
apply_promise.finally(set_waiting).then(() => {
this.send_queued_bond_changes()
this.maybe_send_queued_bond_changes()
})

break
Expand Down Expand Up @@ -971,18 +971,18 @@ patch: ${JSON.stringify(

// Not completely happy with this yet, but it will do for now - DRAL
/** Patches that are being delayed until all cells have finished running. */
this.bonds_changes_to_apply_when_done = []
this.send_queued_bond_changes = () => {
if (this.notebook_is_idle() && this.bonds_changes_to_apply_when_done.length !== 0) {
// console.log("Applying queued bond changes!", this.bonds_changes_to_apply_when_done)
let bonds_patches = this.bonds_changes_to_apply_when_done
this.bonds_changes_to_apply_when_done = []
this.bond_changes_to_apply_when_done = []
this.maybe_send_queued_bond_changes = () => {
if (this.notebook_is_idle() && this.bond_changes_to_apply_when_done.length !== 0) {
// console.log("Applying queued bond changes!", this.bond_changes_to_apply_when_done)
let bonds_patches = this.bond_changes_to_apply_when_done
this.bond_changes_to_apply_when_done = []
this.update_notebook((notebook) => {
applyPatches(notebook, bonds_patches)
})
}
}
/** Whether we just set a bond value which will trigger a cell to run, but we are still waiting for the server to process the bond value (and run the cell). During this time, we won't send new bond values. See https://github.com/fonsp/Pluto.jl/issues/1891 for more info. */
/** This tracks whether we just set a bond value which will trigger a cell to run, but we are still waiting for the server to process the bond value (and run the cell). During this time, we won't send new bond values. See https://github.com/fonsp/Pluto.jl/issues/1891 for more info. */
this.waiting_for_bond_to_trigger_execution = false
/** Number of local updates that have not yet been applied to the server's state. */
this.pending_local_updates = 0
Expand All @@ -992,7 +992,7 @@ patch: ${JSON.stringify(
*/
this.js_init_set = new SetWithEmptyCallback(() => {
// console.info("All scripts finished!")
this.send_queued_bond_changes()
this.maybe_send_queued_bond_changes()
})

// @ts-ignore This is for tests
Expand Down Expand Up @@ -1060,7 +1060,7 @@ patch: ${JSON.stringify(
let is_idle = this.notebook_is_idle()
let changes_involving_bonds = changes.filter((x) => x.path[0] === "bonds")
if (!is_idle) {
this.bonds_changes_to_apply_when_done = [...this.bonds_changes_to_apply_when_done, ...changes_involving_bonds]
this.bond_changes_to_apply_when_done = [...this.bond_changes_to_apply_when_done, ...changes_involving_bonds]
changes = changes.filter((x) => x.path[0] !== "bonds")
}

Expand Down Expand Up @@ -1430,7 +1430,7 @@ The notebook file saves every time you run a cell.`
document.title = "🎈 " + new_state.notebook.shortpath + " — Pluto.jl"
}

this.send_queued_bond_changes()
this.maybe_send_queued_bond_changes()

if (old_state.backend_launch_phase !== this.state.backend_launch_phase && this.state.backend_launch_phase != null) {
const phase = Object.entries(BackendLaunchPhase).find(([k, v]) => v == this.state.backend_launch_phase)?.[0]
Expand Down

0 comments on commit 61e4655

Please sign in to comment.