Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: app version display #576

Closed
wants to merge 14 commits into from
7 changes: 6 additions & 1 deletion src/libraries/Window.res
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ external fcWidget: 'a = "fcWidget"
type boundingClient = {x: int, y: int, width: int, height: int}
@send external getBoundingClientRect: Dom.element => boundingClient = "getBoundingClientRect"

type env = {apiBaseUrl?: string, sdkBaseUrl?: string, mixpanelToken?: string}
type env = {
apiBaseUrl?: string,
sdkBaseUrl?: string,
mixpanelToken?: string,
versionNumber?: string,
}
@val @scope("window")
external env: env = "_env_"
4 changes: 4 additions & 0 deletions src/screens/Sidebar/Sidebar.res
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,10 @@ let make = (
text="Profile"
/>
<MenuOption onClick={handleLogout} text="Sign out" />
<span
className="px-4 py-3 flex text-sm w-full text-offset_white bg-popover-background">
{`App v. ${HSwitchGlobalVars.hyperSwitchAppVersion}`->React.string}
</span>
</div>
}}
</Popover.Panel>
Expand Down
2 changes: 2 additions & 0 deletions src/utils/HSwitchGlobalVars.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@val external appVersion: string = "appVersion"

let hyperSwitchAppVersion = Window.env.versionNumber->Option.getOr("2024.04.10.0")
PritishBudhiraja marked this conversation as resolved.
Show resolved Hide resolved

let mixpanelToken = Window.env.mixpanelToken->Option.getOr("mixpanel-token")

type hostType = Live | Sandbox | Local | Netlify
Expand Down