diff options
Diffstat (limited to 'assets/src/utils/getShareToken.ts')
| -rw-r--r-- | assets/src/utils/getShareToken.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/assets/src/utils/getShareToken.ts b/assets/src/utils/getShareToken.ts index bfe6f58..b470695 100644 --- a/assets/src/utils/getShareToken.ts +++ b/assets/src/utils/getShareToken.ts @@ -1,4 +1,12 @@ -export default (): string => { +import { isClientRequest } from "../stores/constant_state"; + +export default function (): string { + if (!isClientRequest()) { + throw new Error( + "Client is not requesting so it does not have a share token." + ); + } + const splitPath = window.location.pathname.split("/"); return splitPath[splitPath.length - 1]; -}; +} |
