diff options
| author | Mel <einebeere@gmail.com> | 2022-02-17 22:26:29 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-02-17 22:27:55 +0100 |
| commit | 50d3d4080a5b8bf0819e168aa2301e3124a55300 (patch) | |
| tree | 630c5d9908fba0902e93ef3ee9e123f31cef5fc3 /assets/src/utils/getShareToken.ts | |
| parent | e303a189749fe2fdfcb76bd752655de8bf4c7430 (diff) | |
| download | rook-50d3d4080a5b8bf0819e168aa2301e3124a55300.tar.zst rook-50d3d4080a5b8bf0819e168aa2301e3124a55300.zip | |
Set concrete client type during initialization.
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]; -}; +} |
