Skip to content

Commit a60c7d1

Browse files
committed
Fix: use setModel instead of loadModel (petri-view API)
1 parent a0bc90f commit a60c7d1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

public/bitwrap.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ if (btnTemplates) {
294294
const tmplResp = await fetch('/api/templates/' + template.id);
295295
if (tmplResp.ok) {
296296
const tmplData = await tmplResp.json();
297-
if (petriView && petriView.loadModel) {
298-
petriView.loadModel(tmplData);
297+
if (petriView && petriView.setModel) {
298+
petriView.setModel(tmplData);
299299
} else {
300300
// Fallback: show as JSON
301301
const json = JSON.stringify(tmplData, null, 2);
@@ -346,13 +346,13 @@ function downloadFile(filename, content) {
346346
fetch('/o/' + cid)
347347
.then(r => r.ok ? r.json() : null)
348348
.then(data => {
349-
if (data && petriView && petriView.loadModel) {
350-
petriView.loadModel(data);
349+
if (data && petriView && petriView.setModel) {
350+
petriView.setModel(data);
351351
}
352352
})
353353
.catch(err => console.error('Failed to load model:', err));
354354
};
355-
if (petriView && petriView.loadModel) {
355+
if (petriView && petriView.setModel) {
356356
loadCid();
357357
} else if (customElements) {
358358
customElements.whenDefined('petri-view').then(loadCid);
@@ -368,13 +368,13 @@ function downloadFile(filename, content) {
368368
fetch('/api/templates/' + template)
369369
.then(r => r.ok ? r.json() : null)
370370
.then(data => {
371-
if (data && petriView && petriView.loadModel) {
372-
petriView.loadModel(data);
371+
if (data && petriView && petriView.setModel) {
372+
petriView.setModel(data);
373373
}
374374
})
375375
.catch(err => console.error('Failed to load template:', err));
376376
};
377-
if (petriView && petriView.loadModel) {
377+
if (petriView && petriView.setModel) {
378378
loadTemplate();
379379
} else if (customElements) {
380380
customElements.whenDefined('petri-view').then(loadTemplate);

0 commit comments

Comments
 (0)