diff --git a/src/viewer/index.html b/src/viewer/index.html
index 07f2c2c..da4597d 100644
--- a/src/viewer/index.html
+++ b/src/viewer/index.html
@@ -106,8 +106,12 @@
RCSB PDB Mol* Viewer - Test Page
function loadExample(index) {
const e = examples[index];
// let URL, if specified, take precedence over ID
- if (e.url) return viewer.loadStructureFromUrl(e.url, e.format ?? 'mmcif', e.isBinary ?? false, e.config)
- if (e.id) return viewer.loadPdbId(e.id, e.config)
+ if (e.url) {
+ viewer.loadStructureFromUrl(e.url, e.format ?? 'mmcif', e.isBinary ?? false, e.config).then(_ => viewer.resetCamera(0))
+ }
+ if (e.id) {
+ viewer.loadPdbId(e.id, e.config).then(_ => viewer.resetCamera(0))
+ }
}
const examples = [