-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: ensure Jan's Posthog does not refresh UUID
- Loading branch information
1 parent
0108020
commit 90904e3
Showing
4 changed files
with
36 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export type AppConfiguration = { | ||
data_folder: string | ||
quick_ask: boolean | ||
distinct_id?: string | ||
} |
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
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,22 @@ | ||
import { AppConfiguration } from '@janhq/core' | ||
|
||
/** | ||
* Update app distinct Id | ||
* @param id | ||
*/ | ||
export const updateDistinctId = async (id: string) => { | ||
const appConfiguration: AppConfiguration = | ||
await window.core?.api?.getAppConfigurations() | ||
appConfiguration.distinct_id = id | ||
await window.core?.api?.updateAppConfiguration(appConfiguration) | ||
} | ||
|
||
/** | ||
* Retrieve app distinct Id | ||
* @param id | ||
*/ | ||
export const getAppDistinctId = async (): Promise<string | undefined> => { | ||
const appConfiguration: AppConfiguration = | ||
await window.core?.api?.getAppConfigurations() | ||
return appConfiguration.distinct_id | ||
} |