Skip to content

Commit

Permalink
Error handling for set websiteUrl in local storage
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
avikalpg and coderabbitai[bot] authored Mar 21, 2024
1 parent ed06511 commit 4e6f51f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backgroundScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ chrome.runtime.onInstalled.addListener(() => {
const websiteUrl = (environment === "dev") ? "http://localhost:3000" : "https://vibinex.com";

// Store the website URL in Chrome's local storage.
chrome.storage.local.set({ websiteUrl }).then(_ => console.log(`Website URL set to ${websiteUrl};`));
chrome.storage.local.set({ websiteUrl }).then(_ => console.log(`Website URL set to ${websiteUrl};`))
.catch(error => console.error(`Failed to set website URL: ${error}`));

// Make an API call to the backend to create a Rudderstack event when the extension is installed.
chrome.storage.local.get(["userId"]).then(({ userId }) => {
Expand Down

0 comments on commit 4e6f51f

Please sign in to comment.