Skip to content

Commit 567841c

Browse files
Revert "Revert "Address comments""
This reverts commit ab2209d.
1 parent 8b1380c commit 567841c

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/annotator/integrations/html-metadata.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ export class HTMLMetadata {
121121
let version: number | null = null;
122122

123123
for (const candidate of candidates) {
124-
const potential_version = this._findVersion(candidate);
125-
if (!potential_version) {
124+
const potentialVersion = this._findVersion(candidate);
125+
if (!potentialVersion) {
126126
return null;
127127
}
128128

129129
// If the version is not set, set it to the potential version.
130130
// If the version is set and the potential version is different, return null.
131131
if (version === null) {
132-
version = potential_version;
133-
} else if (version !== potential_version) {
132+
version = potentialVersion;
133+
} else if (version !== potentialVersion) {
134134
return null;
135135
}
136136
}

src/sidebar/store/modules/frames.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,11 @@ function searchUrisForFrame(frame: Frame): string[] {
190190

191191
// If the document has a version, append a version suffix to each URI.
192192
// v0 is the base version and should not be appended.
193-
// Only v1 includes v0 annotations (`:v0:v1`), other versions only search their own (`:v{version}`).
193+
// Only v1 includes v0 annotations (`:v0:v{version}`), other versions only search their own (`:v{version}`).
194194
const version = frame.metadata?.version;
195195
if (version && version > 0) {
196-
if (version === 1) {
197-
uris = uris.map(uri => `${uri}:v0:v1`);
198-
} else {
199-
uris = uris.map(uri => `${uri}:v${version}`);
200-
}
196+
const versionSuffix = version === 1 ? `:v0:v${version}` : `:v${version}`;
197+
uris = uris.map(uri => `${uri}${versionSuffix}`);
201198
}
202199

203200
return uris;

0 commit comments

Comments
 (0)