Skip to content

Commit 2f46b2c

Browse files
committed
To the window...
1 parent 6bff574 commit 2f46b2c

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

js/markdown-stream/markdown-stream.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,10 @@ class MarkdownElement extends LightElement {
163163
}
164164

165165
static async #doUnBind(el: HTMLElement): Promise<void> {
166-
if (!window.Shiny) return;
167-
if (!Shiny.unbindAll) return;
166+
if (!window?.Shiny?.unbindAll) return;
168167

169168
try {
170-
Shiny.unbindAll(el);
169+
window.Shiny.unbindAll(el);
171170
} catch (err) {
172171
showShinyClientMessage({
173172
status: "error",
@@ -177,12 +176,11 @@ class MarkdownElement extends LightElement {
177176
}
178177

179178
static async #doBind(el: HTMLElement): Promise<void> {
180-
if (!window.Shiny) return;
181-
if (!Shiny.initializeInputs) return;
182-
if (!Shiny.bindAll) return;
179+
if (!window?.Shiny?.initializeInputs) return;
180+
if (!window?.Shiny?.bindAll) return;
183181

184182
try {
185-
Shiny.initializeInputs(el);
183+
window.Shiny.initializeInputs(el);
186184
} catch (err) {
187185
showShinyClientMessage({
188186
status: "error",
@@ -191,7 +189,7 @@ class MarkdownElement extends LightElement {
191189
}
192190

193191
try {
194-
await Shiny.bindAll(el);
192+
await window.Shiny.bindAll(el);
195193
} catch (err) {
196194
showShinyClientMessage({
197195
status: "error",

js/utils/_utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async function renderDependencies(deps: HtmlDep[]): Promise<void> {
5959
if (!deps) return;
6060

6161
try {
62-
await Shiny.renderDependenciesAsync(deps);
62+
await window.Shiny.renderDependenciesAsync(deps);
6363
} catch (renderError) {
6464
showShinyClientMessage({
6565
status: "error",

shiny/www/py-shiny/chat/chat.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/py-shiny/chat/chat.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/py-shiny/markdown-stream/markdown-stream.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/py-shiny/markdown-stream/markdown-stream.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)