Skip to content

Commit

Permalink
Edit useFetchZipFile so that we get iTAK zip for iUsers
Browse files Browse the repository at this point in the history
It's the second in /api/v1/instructions/user/ tak.zip array so this should do.
  • Loading branch information
benjamsf committed Mar 31, 2024
1 parent 14f8335 commit adccfe0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/assets/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
"serviceTak.step1Description": "<strong>Quickstart Guide</strong> tells you how to start using TAK on your device.",
"serviceTak.step2Description": "The <strong>Usage Guide</strong> tells you how to use the application, according to our standard model.",
"serviceTak.step3Description": "Download the <strong>Client Package</strong> and install it to your TAK device according to the Quickstart Guide, to get using the app.",
"serviceTak.guideButton.quickStart": "Quickstart Guide",
"serviceTak.guideButton.quickStart": "Quickstart",
"serviceTak.guideButton.usage": "Usage Guide",
"serviceTak.grabZipButton": "Download your Client Package",
"serviceTak.grabZipButton.loading": "Loading...",
Expand Down
4 changes: 2 additions & 2 deletions src/assets/locale/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@
"serviceTak.step1Description": "<strong>Käyttöönotto-ohje</strong> opastaa palvelun käyttöönoton laitteellesi.",
"serviceTak.step2Description": "Ohje <strong>Käyttö joukossa</strong> opastaa, miten käytät sovellusta perusmallin mukaisesti.",
"serviceTak.step3Description": "<strong>Viestiperustepaketti</strong> sisältää ladattavat henkilökohtaiset perusteesi.",
"serviceTak.guideButton.quickStart": "Ohje: Käyttöönotto",
"serviceTak.guideButton.usage": "Ohje: Käyttö joukossa",
"serviceTak.guideButton.quickStart": "Käyttöönotto",
"serviceTak.guideButton.usage": "Käyttö joukossa",
"serviceTak.grabZipButton": "Lataa viestiperustepaketti",
"serviceTak.grabZipButton.loading": "Ladataan...",

Expand Down
3 changes: 2 additions & 1 deletion src/hook/api/tak/useFetchZipFile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { UseMutationOptions, useMutation } from "react-query";
import { getOperatingSystem } from "../../helpers/getOperatingSystem";

interface FileData {
title: string;
Expand All @@ -25,7 +26,7 @@ async function fetchZipFile(): Promise<{ blob: Blob; filename: string }> {
}

const data = (await res.json()) as FilesResponse;
const fileData = data.files.tak[0]; // Assuming you want the first file in the 'tak' array
const fileData = data.files.tak[getOperatingSystem() === "iOS" ? 1 : 0]; // Use the second file, which should be 'itak.zip', if user OS is "iOS"

const byteCharacters = atob(fileData.data.split("base64,")[1]);
const byteNumbers = new Array(byteCharacters.length);
Expand Down
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void i18n
.use(ChainedBackend)
.use(initReactI18next)
.init({
lng: "en",
lng: "fi",
fallbackLng: "fi",
backend: {
backends: [
Expand Down

0 comments on commit adccfe0

Please sign in to comment.