mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* chore: Prune redundant comments and normalize lint directives Removes comments that restate the following line and stale TODOs, drops the passive event listener feature check now that all supported browsers support it, and renames eslint directives to oxlint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH * fix: Evaluate restricted team domains at validation time The restricted email provider list was captured when the model loaded, so it could not follow the hosting environment and the tests that covered it never reached the model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH * chore: Replace type suppressions with accurate types Adds a Concrete helper type for registries of abstract classes, declares missing Sequelize and refractor typings, uses public ProseMirror APIs, a typed mock context helper in middleware tests, and a StaticLink component for sidebar rows being edited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH --------- Co-authored-by: Claude <noreply@anthropic.com>
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { useEffect } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import KeyboardShortcuts from "~/components/KeyboardShortcuts";
|
|
import useQuery from "./useQuery";
|
|
import useStores from "./useStores";
|
|
|
|
/**
|
|
* Open the keyboard shortcuts guide when a "shortcuts" param is present in the
|
|
* query string, optionally filtered by the value of the param. This is used to
|
|
* deep link to the guide from external sources, such as emails.
|
|
*/
|
|
export default function useKeyboardShortcutsQuery() {
|
|
const { t } = useTranslation();
|
|
const { dialogs } = useStores();
|
|
const query = useQuery();
|
|
const shortcutsQuery = query.get("shortcuts");
|
|
|
|
useEffect(() => {
|
|
if (shortcutsQuery === null) {
|
|
return;
|
|
}
|
|
|
|
dialogs.openGuide({
|
|
title: t("Keyboard shortcuts"),
|
|
content: <KeyboardShortcuts defaultQuery={shortcutsQuery} />,
|
|
});
|
|
// Only the query param should open the guide, re-running when the other
|
|
// dependencies change would reopen an already dismissed dialog.
|
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [shortcutsQuery]);
|
|
}
|