feat: adding ww feedback button
Some checks failed
Build / build (ubuntu-latest) (push) Has been cancelled
Build / build (windows-2022) (push) Has been cancelled

This commit is contained in:
Zamitto
2026-01-03 19:55:48 -03:00
parent 64815f4f8d
commit 7e7390885e

View File

@@ -52,7 +52,7 @@ export function App() {
const { clearDownload, setLastPacket } = useDownload();
const wokwondersRef = useRef<WorkWondersSdk | null>(null);
const workwondersRef = useRef<WorkWondersSdk | null>(null);
const {
hasActiveSubscription,
@@ -118,24 +118,25 @@ export function App() {
const setupWorkWonders = useCallback(
async (token?: string, locale?: string) => {
if (wokwondersRef.current) return;
if (workwondersRef.current) return;
const possibleLocales = ["en", "pt", "ru"];
const parsedLocale =
possibleLocales.find((l) => l === locale?.slice(0, 2)) ?? "en";
wokwondersRef.current = new WorkWondersSdk();
await wokwondersRef.current.init({
workwondersRef.current = new WorkWondersSdk();
await workwondersRef.current.init({
organization: "hydra",
token,
locale: parsedLocale,
});
await wokwondersRef.current.initChangelogWidget();
wokwondersRef.current.initChangelogWidgetMini();
await workwondersRef.current.initChangelogWidget();
workwondersRef.current.initChangelogWidgetMini();
workwondersRef.current.initFeedbackWidget();
},
[wokwondersRef]
[workwondersRef]
);
const setupExternalResources = useCallback(async () => {
@@ -232,7 +233,7 @@ export function App() {
useEffect(() => {
if (contentRef.current) contentRef.current.scrollTop = 0;
wokwondersRef.current?.notifyUrlChange();
workwondersRef.current?.notifyUrlChange();
}, [location.pathname, location.search]);
useEffect(() => {