-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update uninstall URL with analytics ID (#20)
* bugfix: use correct casing/spacing on workspace amenities string (#14) * bugfix: correct string casing on workspace amenities Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> * revert unnecessary changes Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> * remove umused workflows Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> * feat: add url to open onInstalled (#17) * bugfix: use correct casing/spacing on workspace amenities string (#14) (#15) * bugfix: correct string casing on workspace amenities * feat: add url to open onInstalled Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> * feat: update manifest Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> * feat: update uninstall URL with analytics ID (#19) * feat: update URL with aanalytics id on uninstall Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> * feat: return if no env is found Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> * feat: pull out analytics and rollbar into shared utils Signed-off-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
- Loading branch information
1 parent
aabeeef
commit 6f185cf
Showing
15 changed files
with
60 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
import mixpanel from 'mixpanel-browser'; | ||
import { rollbar, initAnalytics, logUrlChange } from '../utils'; | ||
import { ChromeUrlUpdate } from '../types/Chrome'; | ||
|
||
initAnalytics(); | ||
|
||
chrome.tabs.onUpdated.addListener((tabId, { url }) => { | ||
if (url) { | ||
logUrlChange(url); | ||
|
||
const newUrl: ChromeUrlUpdate = { event: 'URL_UPDATE', url }; | ||
|
||
chrome.tabs.sendMessage(tabId, newUrl); | ||
} | ||
}); | ||
|
||
chrome.runtime.onInstalled.addListener(() => { | ||
chrome.runtime.setUninstallURL('https://offie.co/uninstall'); | ||
const environment = process.env.NODE_ENV; | ||
|
||
if (!environment) { | ||
rollbar.error(`Failed to find NODE_ENV env var!`); | ||
return; | ||
} | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
chrome.runtime.setUninstallURL( | ||
`https://offie.co/uninstall?id=${mixpanel.get_distinct_id()}` | ||
); | ||
|
||
chrome.tabs.create({ | ||
url: 'https://offie.co/welcome', | ||
active: true, | ||
}); | ||
chrome.tabs.create({ | ||
url: 'https://offie.co/welcome', | ||
active: true, | ||
}); | ||
} | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './rollbar'; | ||
export * from './analytics'; |
File renamed without changes.
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