Skip to content

Commit

Permalink
Listen for screen block messages from desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrekker committed Oct 3, 2023
1 parent 72c0fbc commit e76bf90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/components/FilePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const set_cm_value = (/** @type{EditorView} */ cm, /** @type {string} */ value,
* placeholder: String,
* on_submit: (new_path: String) => Promise<void>,
* client: import("../common/PlutoConnection.js").PlutoConnection,
* force_on_blur: Boolean
* }} props
*/
export const FilePicker = ({ value, suggest_new_file, button_label, placeholder, on_submit, client, force_on_blur = true }) => {
Expand Down
6 changes: 6 additions & 0 deletions frontend/components/welcome/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export const Welcome = ({ launch_params }) => {
})
}, [])

useEffect(() => {
window.plutoDesktop?.ipcRenderer.on("set-block-screen-text", (/** @type string */ block_screen_text) => {
set_block_screen_with_this_text(block_screen_text)
})
}, [])

const { show_samples, CustomRecent, CustomPicker } = extended_components

// When block_screen_with_this_text is null (default), all is fine. When it is a string, we show a big banner with that text, and disable all other UI. https://github.com/fonsp/Pluto.jl/pull/2292
Expand Down

0 comments on commit e76bf90

Please sign in to comment.