Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 0 additions & 4 deletions src/libs/actions/Device/getDeviceInfo/getOSAndName/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import Str from 'expensify-common/lib/str';
import RNDeviceInfo from 'react-native-device-info';
import GetOSAndName from './types';

export default function getOSAndName() {
const getOSAndName: GetOSAndName = () => {
const deviceName = RNDeviceInfo.getDeviceNameSync();
const prettyName = `${Str.UCFirst(RNDeviceInfo.getManufacturerSync() || '')} ${deviceName}`;
return {
// Parameter names are predefined and we don't choose it here
// eslint-disable-next-line @typescript-eslint/naming-convention
Comment thread
kowczarz marked this conversation as resolved.
device_name: RNDeviceInfo.isEmulatorSync() ? `Emulator - ${prettyName}` : prettyName,
// Parameter names are predefined and we don't choose it here
// eslint-disable-next-line @typescript-eslint/naming-convention
os_version: RNDeviceInfo.getSystemVersion(),
};
}
};

export default getOSAndName;
12 changes: 12 additions & 0 deletions src/libs/actions/Device/getDeviceInfo/getOSAndName/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {getOSAndName as libGetOSAndName} from 'expensify-common/lib/Device';
import GetOSAndName from './types';

const getOSAndName: GetOSAndName = () => {
// Parameter names are predefined and we don't choose it here
// eslint-disable-next-line @typescript-eslint/naming-convention
Comment thread
kowczarz marked this conversation as resolved.
const {device_name, os_version} = libGetOSAndName();
// Parameter names are predefined and we don't choose it here
// eslint-disable-next-line @typescript-eslint/naming-convention
return {device_name, os_version};
};
export default getOSAndName;
4 changes: 4 additions & 0 deletions src/libs/actions/Device/getDeviceInfo/getOSAndName/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Parameter names are predefined and we don't choose it here
// eslint-disable-next-line @typescript-eslint/naming-convention
Comment thread
kowczarz marked this conversation as resolved.
type GetOSAndName = () => {device_name: string | undefined; os_version: string | undefined};
export default GetOSAndName;