fix: better apple keyboard detection

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-06-29 22:19:19 +02:00 committed by Erik Michelson
parent d10c6d3290
commit 30b374ee5d

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -9,4 +9,5 @@ import { isClientSideRendering } from '../../utils/is-client-side-rendering'
* Determines if the client is running on a Mac.
* This is necessary to e.g. determine different keyboard shortcuts.
*/
export const isMac: () => boolean = () => isClientSideRendering() && navigator.platform.toLowerCase().includes('mac')
export const isMac: () => boolean = () =>
isClientSideRendering() && (navigator.platform.startsWith('Mac') || navigator.platform === 'iPhone')