-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored submodules to simplify setup
- Loading branch information
Showing
7 changed files
with
41 additions
and
41 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
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 |
---|---|---|
@@ -1,5 +1,31 @@ | ||
export const NOTICE = `You seem to have imported something from '@aptabase/electron' which does not export anything. | ||
- Use '@aptabase/electron/main' in your main process. | ||
- Use '@aptabase/electron/preload' in your preload script. | ||
- Use '@aptabase/electron/renderer' in your renderer process.`; | ||
declare global { | ||
interface Window { | ||
__APTABASE__: { | ||
trackEvent( | ||
eventName: string, | ||
props?: Record<string, string | number | boolean> | ||
): void; | ||
}; | ||
} | ||
} | ||
|
||
export function trackEvent( | ||
eventName: string, | ||
props?: Record<string, string | number | boolean> | ||
) { | ||
if (typeof window === "undefined") { | ||
console.error( | ||
"Aptabase: to track events in the main process you must import 'trackEvent' from '@aptabase/electron/main'." | ||
); | ||
return; | ||
} | ||
|
||
if (!window.__APTABASE__) { | ||
console.error( | ||
"Aptabase: You need to call `.exposeAptabase()` from the preload script." | ||
); | ||
return; | ||
} | ||
|
||
window.__APTABASE__.trackEvent(eventName, props); | ||
} |
This file was deleted.
Oops, something went wrong.
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