From b181575a37ea6ab82466271cfdf642c8a18b5ac0 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 11 Feb 2019 00:25:00 +0530 Subject: [PATCH] migrate again --- static/js/viewer.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/static/js/viewer.js b/static/js/viewer.js index bcd1d13..eb4d902 100644 --- a/static/js/viewer.js +++ b/static/js/viewer.js @@ -93,9 +93,14 @@ oml.ui.viewer = function() { oml.api.getAnnotations({ id: ui.item }, function(result) { - console.log(result) - annotations = result.data.annotations - callback && callback(annotations) + if (!result.data.annotations.length && localStorage[oml.user.ui.item + '.annotations_']) { + localStorage[oml.user.ui.item + '.annotations'] = localStorage[oml.user.ui.item + '.annotations_'] + loadAnnotations(callback) + + } else { + annotations = result.data.annotations + callback && callback(annotations) + } }) } }