Skip to content

Commit f6c1f2c

Browse files
committed
test cached versjon i åpne-knappen
1 parent 1297c75 commit f6c1f2c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

xp-archive/client/content/Content.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ export const Content = () => {
9595
}`;
9696

9797
const getVersionDisplay = () => {
98+
// First check if we have the version in our cache
99+
if (selectedVersion && versionSelectorCache.versions.length > 0) {
100+
const cachedVersion = versionSelectorCache.versions.find(
101+
(v) => v.versionId === selectedVersion
102+
);
103+
if (cachedVersion?.timestamp) {
104+
return formatTimestamp(cachedVersion.timestamp);
105+
}
106+
}
107+
108+
// Fall back to data if cache doesn't have it
98109
if (selectedVersion && data?.versions) {
99110
return formatTimestamp(
100111
data.versions.find((v) => v.versionId === selectedVersion)?.timestamp ?? ''

0 commit comments

Comments
 (0)