Use correct rageshake URL when running in embedded package + tests (#3132)

* Use correct rageshake URL when running in embedded package

It was incorrectly trying to use the one from config.json

* Refactor to add tests

* Empty mock config
This commit is contained in:
Hugh Nimmo-Smith
2025-03-31 16:38:25 +01:00
committed by GitHub
parent e4c222a4e8
commit d1753c33f5
4 changed files with 235 additions and 78 deletions

View File

@@ -30,7 +30,7 @@ import { PreferencesSettingsTab } from "./PreferencesSettingsTab";
import { Slider } from "../Slider";
import { DeviceSelection } from "./DeviceSelection";
import { DeveloperSettingsTab } from "./DeveloperSettingsTab";
import { isRageshakeAvailable } from "./submit-rageshake";
import { useSubmitRageshake } from "./submit-rageshake";
type SettingsTab =
| "audio"
@@ -71,6 +71,8 @@ export const SettingsModal: FC<Props> = ({
const [showDeveloperSettingsTab] = useSetting(developerMode);
const { available: isRageshakeAvailable } = useSubmitRageshake();
const audioTab: Tab<SettingsTab> = {
key: "audio",
name: t("common.audio"),
@@ -148,7 +150,7 @@ export const SettingsModal: FC<Props> = ({
const tabs = [audioTab, videoTab];
if (widget === null) tabs.push(profileTab);
tabs.push(preferencesTab);
if (isRageshakeAvailable() || import.meta.env.VITE_PACKAGE === "full") {
if (isRageshakeAvailable || import.meta.env.VITE_PACKAGE === "full") {
// for full package we want to show the analytics consent checkbox
// even if rageshake is not available
tabs.push(feedbackTab);