diff --git a/src/components/Editor/components/Sidebar.tsx b/src/components/Editor/components/Sidebar.tsx index f7fb7415..03141f07 100644 --- a/src/components/Editor/components/Sidebar.tsx +++ b/src/components/Editor/components/Sidebar.tsx @@ -1,14 +1,14 @@ -import { For, Show, createEffect, createSignal, onCleanup } from 'solid-js' +import { For, Show, createEffect, createSignal, onCleanup, onMount } from 'solid-js' import { unwrap } from 'solid-js/store' import { undo, redo } from 'prosemirror-history' import { Draft, useState } from '../store/context' -import { mod } from '../env' import * as remote from '../remote' import { isEmpty } from '../prosemirror/helpers' import type { Styled } from './Layout' import '../styles/Sidebar.scss' import { clsx } from 'clsx' import styles from './Sidebar.module.scss' +import { isServer } from 'solid-js/web' const Off = (props) => @@ -141,6 +141,12 @@ export const Sidebar = () => { onCleanup(() => clearTimeout(id)) }) + const [mod, setMod] = createSignal<'Ctrl' | 'Cmd'>('Ctrl') + + onMount(() => { + setMod(navigator.platform.includes('Mac') ? 'Cmd' : 'Ctrl') + }) + return (
@@ -149,55 +155,54 @@ export const Sidebar = () => { editorView().focus()}>