@salesforcedevs/docs-components 1.3.124-old-version-banner-3 → 1.3.124-old-version-banner-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -40,14 +40,19 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
40
40
|
let info = null;
|
|
41
41
|
if (!this.disableVersion) {
|
|
42
42
|
const currentGAVersion = this.versionOptions.find((version) => version.url.includes(version.id));
|
|
43
|
-
if (currentGAVersion?.link?.href) {
|
|
43
|
+
if (currentGAVersion?.link?.href && this.version?.id) {
|
|
44
44
|
const versionNo = currentGAVersion.id;
|
|
45
45
|
/**
|
|
46
46
|
* Need to show old version doc banner only if the version is less than the current ga version
|
|
47
47
|
* We should not show it to the preview version whose version is more than ga
|
|
48
48
|
**/
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
try {
|
|
50
|
+
if (parseFloat(this.version.id) < parseFloat(versionNo)) {
|
|
51
|
+
info = oldVersionDocInfo(currentGAVersion.link.href)
|
|
52
|
+
}
|
|
53
|
+
} catch (exception) {
|
|
54
|
+
/* Ideally this use case should not happen, but just added to not to break the page*/
|
|
55
|
+
console.warn(exception);
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
}
|