about summary refs log tree commit diff
path: root/assets/src/utils/getShareToken.ts
blob: 3bae6f1c4efe20219e8c78f8f2d1b7d232157a03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import { isClientRequest } from "../state/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];
}