Browse Source

Send platform to the graph

main
Miggy Eusebio 2 years ago
parent
commit
c35d4b9ab4
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      src/webviews/apps/plus/graph/GraphWrapper.tsx

+ 17
- 0
src/webviews/apps/plus/graph/GraphWrapper.tsx View File

@ -2,11 +2,13 @@ import GraphContainer, {
type CssVariables,
type GraphColumnSetting as GKGraphColumnSetting,
type GraphColumnsSettings as GKGraphColumnsSettings,
type GraphPlatform,
type GraphRow,
type GraphZoneType,
} from '@gitkraken/gitkraken-components';
import type { ReactElement } from 'react';
import React, { createElement, useEffect, useRef, useState } from 'react';
import { getPlatform } from '@env/platform';
import type { GraphColumnConfig } from '../../../../config';
import { RepositoryVisibility } from '../../../../git/gitProvider';
import type { GitGraphRowType } from '../../../../git/models/graph';
@ -114,6 +116,20 @@ const getIconElementLibrary = (iconKey: string) => {
return iconElementLibrary[iconKey];
};
const getClientPlatform = (): GraphPlatform => {
switch (getPlatform()) {
case 'web-macOS':
return 'darwin';
case 'web-windows':
return 'win32';
case 'web-linux':
default:
return 'linux';
}
};
const clientPlatform = getClientPlatform();
// eslint-disable-next-line @typescript-eslint/naming-convention
export function GraphWrapper({
subscriber,
@ -421,6 +437,7 @@ export function GraphWrapper({
onColumnResized={handleOnColumnResized}
onSelectGraphRows={handleSelectGraphRows}
onShowMoreCommits={handleMoreCommits}
platform={clientPlatform}
width={mainWidth}
themeOpacityFactor={styleProps.themeOpacityFactor}
/>

Loading…
Cancel
Save