Skip to content

Commit

Permalink
fix exports and add alerts to explain what is up
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr committed Sep 18, 2024
1 parent 5d0860b commit cb0d230
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/police/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const RESTRICED_SUBREGION: Record<string, Set<string>> = {
UA: new Set([crimea, luhansk, donetska]),
};

export function isForbiddenLand(iso3166Country: string, iso3166Region: string) {
function isForbiddenLand(iso3166Country: string, iso3166Region: string) {
const iso3166CountryUppercase = iso3166Country?.toUpperCase();
return (
RESTRICTED_COUNTRIES.has(iso3166CountryUppercase) ||
Expand Down
2 changes: 2 additions & 0 deletions src/components/police.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ function usePolice() {
isSanctionedAddress(address).then((isSanctioned) => {
if (isSanctioned) {
disconnect();
alert('The Address is under OFAC Sanctions');
}
});
fetch('/police').then((response) => {
if (response.status === 451) {
disconnect();
alert('The Region is under Sanction');
}
});
}
Expand Down

0 comments on commit cb0d230

Please sign in to comment.