From d79af73add6a925eb8092be311957c5d14371a8d Mon Sep 17 00:00:00 2001 From: Thomas Prouvot Date: Wed, 8 Nov 2023 11:40:40 +0100 Subject: [PATCH 1/2] Since instance can be updated, store org instance in session storage instead of localStorage --- addon/popup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addon/popup.js b/addon/popup.js index 535ffead..b5137d49 100644 --- a/addon/popup.js +++ b/addon/popup.js @@ -134,11 +134,11 @@ class App extends React.PureComponent { removeEventListener("keydown", this.onShortcutKey); } getOrgInstance(sfHost) { - let orgInstance = localStorage.getItem(sfHost + "_orgInstance"); + let orgInstance = sessionStorage.getItem(sfHost + "_orgInstance"); if (orgInstance == null) { sfConn.rest("/services/data/v" + apiVersion + "/query/?q=SELECT+InstanceName+FROM+Organization").then(res => { orgInstance = res.records[0].InstanceName; - localStorage.setItem(sfHost + "_orgInstance", orgInstance); + sessionStorage.setItem(sfHost + "_orgInstance", orgInstance); }); } return orgInstance; @@ -237,8 +237,8 @@ class App extends React.PureComponent { h("div", {className: "slds-grid slds-theme_shade slds-p-around_small slds-border_top"}, h("div", {className: "slds-col slds-size_5-of-12 footer-small-text slds-m-top_xx-small"}, h("a", {href: "https://tprouvot.github.io/Salesforce-Inspector-reloaded/release-note/", title: "Release note", target: linkTarget}, "v" + addonVersion), - h("span", {}, " / "), - h("a", {href: "https://status.salesforce.com/instances/" + orgInstance, title: "Instance status", target: linkTarget}, orgInstance), + orgInstance ? h("span", {}, " / ") : "", + orgInstance ? h("a", {href: "https://status.salesforce.com/instances/" + orgInstance, title: "Instance status", target: linkTarget}, orgInstance) : "", h("span", {}, " / "), h("input", { className: "api-input", From 3de7e43caaae3b22bff21f3e579c06be39d648c7 Mon Sep 17 00:00:00 2001 From: Thomas Prouvot Date: Wed, 8 Nov 2023 11:45:06 +0100 Subject: [PATCH 2/2] Increase extension version --- CHANGES.md | 4 ++++ addon/manifest-template.json | 2 +- addon/manifest.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 40b682b6..fefcf975 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## Version 1.21 + +- Org instance in not correct with after Hyperforce migration: store org instance in sessionStorage to retrieve it once per session [issue 167](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/167) + ## Version 1.20 - Move popup arrow icon in Flow Builder because of Winter 24 UI changes [feature 200](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/200) diff --git a/addon/manifest-template.json b/addon/manifest-template.json index e201f6f0..6219683b 100644 --- a/addon/manifest-template.json +++ b/addon/manifest-template.json @@ -1,7 +1,7 @@ { "name": "Salesforce Inspector reloaded", "description": "Productivity tools for Salesforce administrators and developers to inspect data and metadata directly from the Salesforce UI.", - "version": "1.20", + "version": "1.21", "icons": { "128": "icon128.png" }, diff --git a/addon/manifest.json b/addon/manifest.json index 1737080c..16e5349f 100644 --- a/addon/manifest.json +++ b/addon/manifest.json @@ -1,7 +1,7 @@ { "name": "Salesforce Inspector reloaded", "description": "Productivity tools for Salesforce administrators and developers to inspect data and metadata directly from the Salesforce UI.", - "version": "1.20", + "version": "1.21", "icons": { "128": "icon128.png" },