diff --git a/public/index.html b/public/index.html
index 699c003..4810f6f 100644
--- a/public/index.html
+++ b/public/index.html
@@ -94,7 +94,8 @@
Homer: The Odyssey
relationVocabulary: [ 'isRelated', 'isPartOf', 'isSameAs ']
});
- r.loadAnnotations('annotations.w3c.json');
+ r.loadAnnotations('annotations.w3c.json')
+ .then(() => console.log('loaded'));
r.on('selectAnnotation', function(a) {
console.log('selected', a);
diff --git a/src/TextAnnotator.jsx b/src/TextAnnotator.jsx
index 02f18d4..d6523ba 100644
--- a/src/TextAnnotator.jsx
+++ b/src/TextAnnotator.jsx
@@ -307,7 +307,8 @@ export default class TextAnnotator extends Component {
this.relationsLayer.clear();
const clones = annotations.map(a => a.clone());
- this.highlighter.init(clones).then(() =>
+
+ return this.highlighter.init(clones).then(() =>
this.relationsLayer.init(clones));
}
diff --git a/src/index.jsx b/src/index.jsx
index f2b68a9..b846416 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -125,8 +125,7 @@ export class Recogito {
loadAnnotations = (url, requestArgs) => fetch(url, requestArgs)
.then(response => response.json()).then(annotations => {
- this.setAnnotations(annotations);
- return annotations;
+ return this.setAnnotations(annotations).then(() => annotations);
});
off = (event, callback) =>
@@ -146,7 +145,7 @@ export class Recogito {
setAnnotations = arg => {
const annotations = arg || [];
const webannotations = annotations.map(a => new WebAnnotation(a));
- this._app.current.setAnnotations(webannotations);
+ return this._app.current.setAnnotations(webannotations);
}
setAuthInfo = authinfo =>