Skip to content

Commit

Permalink
Merge pull request #101 from PapillonApp/Remove-PassAPI
Browse files Browse the repository at this point in the history
chore: Remove unused generate-pass utility function and related code
  • Loading branch information
tryon-dev authored Aug 31, 2024
2 parents ee8dc71 + 12e96ce commit 98def63
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
22 changes: 0 additions & 22 deletions src/utils/external/generate-pass.ts

This file was deleted.

28 changes: 0 additions & 28 deletions src/views/account/Restaurant/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
NativeListHeader,
NativeText,
} from "@/components/Global/NativeComponents";
import { generatePass } from "@/utils/external/generate-pass";
import { useCurrentAccount } from "@/stores/account";
import { AccountService } from "@/stores/account/types";
import TabAnimatedTitle from "@/components/Global/TabAnimatedTitle";
Expand All @@ -50,33 +49,6 @@ const Menu: Screen<"Menu"> = ({
});
}, [navigation, route.params, theme.colors.text]);

// Fonction pour générer et afficher un pass pour Apple Wallet
const generateWalletPass = async (): Promise<void> => {
const data = {
name: account?.name ?? "",
classe: account?.className ?? "",
service: AccountService[account?.service ?? AccountService.Pronote],
data: "123456789",
type: "PKBarcodeFormatQR",
encoding: "iso-8859-1",
};

try {
console.log("Generating wallet pass...");
console.log(data);
const response = await generatePass(data);
if (response) {
WebBrowser.openBrowserAsync(response.url, {
enableBarCollapsing: true,
presentationStyle:
WebBrowser.WebBrowserPresentationStyle.AUTOMATIC,
});
}
} catch (error) {
console.error("Error generating wallet pass:", error);
}
};

const [balances, setBalances] = useState<Balance[] | null>(null);

useEffect(() => {
Expand Down

0 comments on commit 98def63

Please sign in to comment.