fetchPath

Returns the user's current location within the application. Only supports paths that are located within the /inboxes route.

Use this function to capture the location of a user within the /inboxes routes. For example, to note which inbox a user is viewing or the current message the user has open. If your plugin navigates the user away from this location, you can pass the response of this location to openUrl to return the user to the location of interest.

function fetchPath(cancelToken?: CancelToken): Promise<string>;

Parameters

ParameterTypeDescription
cancelTokenCancelToken (optional)Token to cancel the request.

Return value

The function returns a Promise that resolves with the current path of the user. Pass this value to openUrl to return the user to the given location within the /inboxes routes at a later point.

📘

This function does not return a path when the user is composing a new message in a popover window.

If the user is in the noConversationPopover context, this function returns a value of composing-new because there is no route associated to the user when they are viewing a popped-out composer window for a brand new message they are creating. You cannot use the composing-new value to resolve the user's path or in other functions like openUrl.

Examples

Front.fetchPath(); // Example response: /inboxes/teammates/###/inbox/open/###