mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: detect linux
This commit is contained in:
parent
49df251ed6
commit
0f654996b2
2 changed files with 3 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ export function Node({
|
|||
onClick={event => {
|
||||
if (
|
||||
(os === OperatingSystems.macOS && event.metaKey) ||
|
||||
(os === OperatingSystems.Linux && event.ctrlKey) ||
|
||||
(os === OperatingSystems.Windows && event.ctrlKey)
|
||||
) {
|
||||
// The default behavior, open in new tab
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export function pick<T>(source: T, keys: string[]): Partial<T> {
|
|||
export enum OperatingSystems {
|
||||
Windows = 'Windows',
|
||||
macOS = 'Macintosh',
|
||||
Linux = 'Linux',
|
||||
others = 'unknown',
|
||||
}
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ function detectOS(): OperatingSystems {
|
|||
} = window
|
||||
if (userAgent.indexOf(OperatingSystems.Windows) !== -1) return OperatingSystems.Windows
|
||||
else if (userAgent.indexOf(OperatingSystems.macOS) !== -1) return OperatingSystems.macOS
|
||||
else if (userAgent.indexOf(OperatingSystems.Linux) !== -1) return OperatingSystems.Linux
|
||||
return OperatingSystems.others
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue