Verified Commit f91fc90a authored by Mehdi Baaboura's avatar Mehdi Baaboura
Browse files

Added environment variable to enable or disable the account switcher

parent 2d82e7f2
......@@ -39,6 +39,7 @@ MAILER_FROM=
API_ENDPOINT=https://qpostapp.com/api
POST_CHARACTER_LIMIT=300
INCREASED_POST_CHARACTER_LIMIT=1000
ACCOUNT_SWITCHER_ENABLED=1
GIGADRIVE_APP_ID=
GIGADRIVE_APP_SECRET=
GIGADRIVE_LEGACY_API_KEY=
......@@ -91,4 +92,4 @@ GOOGLE_CLIENT_SECRET=
###< google/apiclient ###
ENQUEUE_DSN=
ENQUEUE_QUEUE=
ENQUEUE_QUEUE=
\ No newline at end of file
......@@ -71,14 +71,14 @@ export default class DesktopHeaderAccountDropdown extends Component<{
<i className="fas fa-wrench iconMargin-10"/>{__("navigation.account.settings")}
</a>
<Link to={"#"} onClick={(e) => {
{window["ACCOUNT_SWITCHER_ENABLED"] === true ? <Link to={"#"} onClick={(e) => {
e.preventDefault();
DesktopHeaderAccountDropdown.close(this.props.parent);
AccountSwitcher.open();
}}>
<i className={"fas fa-user-friends iconMargin-10"}/>{__("navigation.account.switch")}
</Link>
</Link> : ""}
<Link to={"#"} onClick={(e) => {
e.preventDefault();
......
......@@ -124,7 +124,7 @@ export default class MobileSider extends Component<{
<span className="nav-text">{__("navigation.account.settings")}</span>
</a>
</Menu.Item>,
<Menu.Item key="3">
window["ACCOUNT_SWITCHER_ENABLED"] === true ? <Menu.Item key="3">
<Link to={"#"} onClick={(e) => {
e.preventDefault();
AccountSwitcher.open();
......@@ -133,7 +133,7 @@ export default class MobileSider extends Component<{
<i className={"fas fa-user-friends iconMargin-10"}/>
<span className="nav-text">{__("navigation.account.switch")}</span>
</Link>
</Menu.Item>,
</Menu.Item> : "",
<Menu.Item key="4">
<Link to={"#"} onClick={(e) => {
e.preventDefault();
......
......@@ -93,8 +93,10 @@
window["VAPID_SERVER_KEY"] = "{{ bentools_webpush.server_key }}";
window["GATEWAY_HOST"] = "{{ _ENV["GATEWAY_HOST"] }}";
window["GATEWAY_PORT"] = {{ _ENV["GATEWAY_PORT"] }};
window["GATEWAY_HOST"] = "{{ env("GATEWAY_HOST") }}";
window["GATEWAY_PORT"] = {{ env("GATEWAY_PORT") }};
window["ACCOUNT_SWITCHER_ENABLED"] = {{ env("ACCOUNT_SWITCHER_ENABLED") == 1 ? "true" : "false" }};
window["GITLAB_RELEASES_URL"] = "{{ gitlab.releasesListURL }}";
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment