Skip to content

Commit

Permalink
Fjerne route based Task Analytic, oppdatere til ny TA skjema
Browse files Browse the repository at this point in the history
  • Loading branch information
nattaphongklinjan committed Nov 13, 2024
1 parent e18c7ff commit 426f355
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { GetServerSidePropsContext, GetServerSidePropsResult } from "next";
import Head from "next/head";
import { useEffect } from "react";
import { AccountNumber } from "../components/account-number/AccountNumber";
import { JournalpostList } from "../components/journalposter/JournalpostList";
import { MeldFraOmEndring } from "../components/meld-fra-om-endring/MeldFraOmEndring";
import { NoSessionModal } from "../components/no-session-modal/NoSessionModal";
import { PageHero } from "../components/page-hero/PageHero";
import { Shortcuts } from "../components/shortcuts/Shortcuts";
import { Soknader } from "../components/soknader/Soknader";
import { UxSignalsWidget } from "../components/UxSignalsWidget";
import { useSanity } from "../context/sanity-context";
import { innsynAudience } from "../lib/audience";
import { getSession } from "../lib/auth.utils";
import Metrics from "../lib/metrics";
import { innenfor12Uker } from "../util/soknadDato.util";
import { PaabegyntSoknad, hentPaabegynteSoknader } from "./api/paabegynteSoknader";
import { Søknad, hentSoknader } from "./api/soknader";
import { UxSignalsWidget } from "../components/UxSignalsWidget";
import { useRouter } from "next/router";
import { useEffect } from "react";

interface Props {
fullforteSoknader: Søknad[] | null;
Expand Down Expand Up @@ -96,27 +95,17 @@ export async function getServerSideProps(

export default function Status({ fullforteSoknader, paabegynteSoknader, env }: Props) {
const { getAppText } = useSanity();
const router = useRouter();

useEffect(() => {
// Task analytic Spørreundersøkelse for gammel og ny vedtaksbrev
const nyBrev = env.appEnv === "production" ? "03409" : "03400";
const gammelBrev = env.appEnv === "production" ? "03408" : "03400";

setTimeout(() => {
//@ts-ignore Ukjent TA type
if (router.query && typeof window.TA === "function") {
if (router.query.brev === "ny") {
//@ts-ignore Ukjent TA type
window.TA("start", nyBrev);
}

if (router.query.brev === "gammel") {
//@ts-ignore Ukjent TA type
window.TA("start", gammelBrev);
}
if (typeof window.TA === "function") {
//@ts-ignore Ukjent TA type
window.TA("start", "03411");
}
}, 2000);
}, 1000);
});

const hasFullforteSoknader =
Expand Down

0 comments on commit 426f355

Please sign in to comment.