mirror of
https://github.com/outline/outline.git
synced 2026-11-22 05:51:43 +03:00
* feat: Allow document links to suppress view recording Adds a suppressView query parameter that prevents a view from being recorded when a document is opened, removing it from the URL afterwards so that copied links record views as normal. * refactor: Use useConsumeQueryParam to read suppressView Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
14 lines
495 B
TypeScript
14 lines
495 B
TypeScript
/** The query parameter that prevents a document view from being recorded. */
|
|
export const SuppressViewParam = "suppressView";
|
|
|
|
/**
|
|
* Returns a path to a document that will not record a view when opened, so
|
|
* that reviewing activity does not change it.
|
|
*
|
|
* @param path the frontend path to the document.
|
|
* @returns the path with the parameter appended.
|
|
*/
|
|
export function suppressView(path: string): string {
|
|
return `${path}${path.includes("?") ? "&" : "?"}${SuppressViewParam}=true`;
|
|
}
|