-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change files structure and add types.ts file
- Loading branch information
Showing
5 changed files
with
11 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import ELECTRON_EVENTS from '../../../../../desktop/ELECTRON_EVENTS'; | ||
import GenerateDeviceID from './types'; | ||
|
||
/** | ||
* Get the unique ID of the current device. This should remain the same even if the user uninstalls and reinstalls the app. | ||
*/ | ||
function generateDeviceID(): Promise<string> { | ||
return window.electron.invoke(ELECTRON_EVENTS.REQUEST_DEVICE_ID); | ||
} | ||
const generateDeviceID: GenerateDeviceID = () => window.electron.invoke(ELECTRON_EVENTS.REQUEST_DEVICE_ID); | ||
Check failure on line 7 in src/libs/actions/Device/generateDeviceID/index.desktop.ts GitHub Actions / lint
|
||
|
||
export default generateDeviceID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import DeviceInfo from 'react-native-device-info'; | ||
import GenerateDeviceID from './types'; | ||
|
||
const deviceID = DeviceInfo.getDeviceId(); | ||
|
||
/** | ||
* Get the unique ID of the current device. This should remain the same even if the user uninstalls and reinstalls the app. | ||
*/ | ||
function generateDeviceID(): Promise<string> { | ||
return DeviceInfo.getUniqueId().then((uniqueID) => `${deviceID}_${uniqueID}`); | ||
} | ||
const generateDeviceID: GenerateDeviceID = () => DeviceInfo.getUniqueId().then((uniqueID) => `${deviceID}_${uniqueID}`); | ||
|
||
export default generateDeviceID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
type GenerateDeviceID = () => Promise<string>; | ||
|
||
export default GenerateDeviceID; |