You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.web.ts 839B

123456789101112131415161718192021222324252627282930313233
  1. import { IStateful } from '../base/app/types';
  2. import { toState } from '../base/redux/functions';
  3. import { getServerURL } from '../base/settings/functions.web';
  4. export * from './functions.any';
  5. /**
  6. * Retrieves the default URL for the app. This can either come from a prop to
  7. * the root App component or be configured in the settings.
  8. *
  9. * @param {Function|Object} stateful - The redux store or {@code getState}
  10. * function.
  11. * @returns {string} - Default URL for the app.
  12. */
  13. export function getDefaultURL(stateful: IStateful) {
  14. const state = toState(stateful);
  15. const { href } = window.location;
  16. if (href) {
  17. return href;
  18. }
  19. return getServerURL(state);
  20. }
  21. /**
  22. * Returns application name.
  23. *
  24. * @returns {string} The application name.
  25. */
  26. export function getName() {
  27. return interfaceConfig.APP_NAME;
  28. }