FIX: Keyboard shortcut should be platform specific (#801)
This commit is contained in:
parent
9cd14b0003
commit
9374cd7ac1
|
@ -3,6 +3,8 @@ import { fn } from "@ember/helper";
|
||||||
import { service } from "@ember/service";
|
import { service } from "@ember/service";
|
||||||
import { and } from "truth-helpers";
|
import { and } from "truth-helpers";
|
||||||
import DButton from "discourse/components/d-button";
|
import DButton from "discourse/components/d-button";
|
||||||
|
import { PLATFORM_KEY_MODIFIER } from "discourse/lib/keyboard-shortcuts";
|
||||||
|
import { translateModKey } from "discourse/lib/utilities";
|
||||||
import eq from "truth-helpers/helpers/eq";
|
import eq from "truth-helpers/helpers/eq";
|
||||||
import AiHelperCustomPrompt from "../components/ai-helper-custom-prompt";
|
import AiHelperCustomPrompt from "../components/ai-helper-custom-prompt";
|
||||||
|
|
||||||
|
@ -13,6 +15,10 @@ export default class AiHelperOptionsList extends Component {
|
||||||
return this.site.desktopView && this.args.shortcutVisible;
|
return this.site.desktopView && this.args.shortcutVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get shortcut() {
|
||||||
|
return translateModKey(`${PLATFORM_KEY_MODIFIER}+alt+p`);
|
||||||
|
}
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ul class="ai-helper-options">
|
<ul class="ai-helper-options">
|
||||||
{{#each @options as |option|}}
|
{{#each @options as |option|}}
|
||||||
|
@ -33,7 +39,7 @@ export default class AiHelperOptionsList extends Component {
|
||||||
class="ai-helper-options__button"
|
class="ai-helper-options__button"
|
||||||
>
|
>
|
||||||
{{#if (and (eq option.name "proofread") this.showShortcut)}}
|
{{#if (and (eq option.name "proofread") this.showShortcut)}}
|
||||||
<kbd class="shortcut">⌘⌥p</kbd>
|
<kbd class="shortcut">{{this.shortcut}}</kbd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</DButton>
|
</DButton>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue