diff options
author | Ivan Chen <ivan@tagg.id> | 2021-05-19 17:37:03 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-05-19 17:37:03 -0400 |
commit | 2531a2b672bb60e871d419453ae8558f0869bce3 (patch) | |
tree | b23f79f6378384cffff9e032d12066014e9dafff /src/utils/common.ts | |
parent | 1a4113ee3e47be229e28fc5a935ada174781b00b (diff) | |
parent | cddcfef3c32e08aedef1e4908bd477e45bef1974 (diff) |
Merge branch 'master' into tma858-remind-users
# Conflicts:
# src/components/friends/InviteFriendTile.tsx
Diffstat (limited to 'src/utils/common.ts')
-rw-r--r-- | src/utils/common.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/utils/common.ts b/src/utils/common.ts index ce4ab7d1..95e77f64 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -180,3 +180,20 @@ const _crestIcon = (university: UniversityType) => { return require('../assets/images/bwbadges.png'); } }; + +export const validateImageLink = async (url: string | undefined) => { + if (!url) { + return false; + } + return fetch(url) + .then((res) => { + if (res.status === 200) { + return true; + } else { + return false; + } + }) + .catch((_) => { + return false; + }); +}; |