Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make localizeMod SSR safe#126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dgreif merged 10 commits intomainfromcbodfield/localized-mod-ssr
May 6, 2024
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Lint fixes
  • Loading branch information
@Cbodfield
Cbodfield authoredMay 6, 2024
commitd7504aca8e854edf1fd243a307abac4b3d956482
2 changes: 1 addition & 1 deletionsrc/hotkey.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,7 +90,7 @@ const matchApplePlatform = /Mac|iPod|iPhone|iPad/i

function localizeMod(hotkey: string, platform?: string | undefined): string {
const ssrSafeWindow = typeof window === 'undefined' ? undefined : window
const safePlatform = platform ?? ssrSafeWindow?.navigator.platform ??""
const safePlatform = platform ?? ssrSafeWindow?.navigator.platform ??''

const localModifier = matchApplePlatform.test(safePlatform) ? 'Meta' : 'Control'
return hotkey.replace('Mod', localModifier)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp