Skip to content

Commit d9cdeee

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

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
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",

0 commit comments

Comments
 (0)