Skip to content

Commit e66ffa0

Browse files
committed
feat: only define progress element if enabled
1 parent 0c855ac commit e66ffa0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

client-src/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import reloadApp from "./utils/reloadApp.js";
1111
import createSocketURL from "./utils/createSocketURL.js";
1212
import { isProgressSupported, defineProgressElement } from "./progress.js";
1313

14-
defineProgressElement();
15-
1614
/**
1715
* @typedef {Object} OverlayOptions
1816
* @property {boolean | (error: Error) => boolean} [warnings]
@@ -243,6 +241,7 @@ const onSocketMessage = {
243241
if (typeof options.progress === "string") {
244242
let progress = document.querySelector("wds-progress");
245243
if (!progress) {
244+
defineProgressElement();
246245
progress = document.createElement("wds-progress");
247246
document.body.appendChild(progress);
248247
}

client-src/progress.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export function isProgressSupported() {
197197
}
198198

199199
export function defineProgressElement() {
200-
if (!isProgressSupported() || customElements.get("wds-progress")) {
200+
if (customElements.get("wds-progress")) {
201201
return;
202202
}
203203

types/lib/Server.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,8 @@ declare class Server<
732732
ClientProgress: {
733733
description: string;
734734
link: string;
735-
type: string;
735+
type: string[];
736+
enum: (string | boolean)[];
736737
cli: {
737738
negatedDescription: string;
738739
};

0 commit comments

Comments
 (0)