Commit 617f952c authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Add prefix to distinguish provenance of `$tag`

For debugging purposes having a prefix to indicate whether the annotation was created locally ('a:' for the annotator, 's:' for the sidebar) or fetched from the server may be useful.
parent 25f1a776
...@@ -110,7 +110,7 @@ export class AnnotationSync { ...@@ -110,7 +110,7 @@ export class AnnotationSync {
if (annotation.$tag) { if (annotation.$tag) {
return annotation; return annotation;
} }
tag = tag || generateHexString(8); tag = tag || 'a:' + generateHexString(8);
Object.defineProperty(annotation, '$tag', { Object.defineProperty(annotation, '$tag', {
value: tag, value: tag,
}); });
......
...@@ -70,7 +70,7 @@ export class AnnotationsService { ...@@ -70,7 +70,7 @@ export class AnnotationsService {
// We need a unique local/app identifier for this new annotation such // We need a unique local/app identifier for this new annotation such
// that we might look it up later in the store. It won't have an ID yet, // that we might look it up later in the store. It won't have an ID yet,
// as it has not been persisted to the service. // as it has not been persisted to the service.
const $tag = generateHexString(8); const $tag = 's:' + generateHexString(8);
/** @type {Annotation} */ /** @type {Annotation} */
const annotation = Object.assign( const annotation = Object.assign(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment