Skip to content

Commit

Permalink
fix: background script not running on production
Browse files Browse the repository at this point in the history
  • Loading branch information
Kholid060 committed Oct 27, 2021
1 parent 2585b0e commit e3b6016
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 9 additions & 5 deletions src/background/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ browser.alarms.onAlarm.addListener(({ name }) => {
});
});

browser.runtime.onInstalled.addListener((details) => {
chrome.runtime.onInstalled.addListener((details) => {
if (details.reason === 'install') {
browser.storage.local
.set({
Expand All @@ -71,10 +71,14 @@ browser.runtime.onInstalled.addListener((details) => {
visitWebTriggers: [],
})
.then(() => {
browser.tabs.create({
active: true,
url: browser.runtime.getURL('newtab.html#/workflows'),
});
browser.tabs
.create({
active: true,
url: browser.runtime.getURL('newtab.html#/workflows'),
})
.catch((error) => {
console.error(error);
});
});
}
});
Expand Down
4 changes: 0 additions & 4 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ const store = createStore({
});
const { isFirstTime } = await browser.storage.local.get('isFirstTime');

console.log(
await browser.storage.local.get('isFirstTime'),
isFirstTime
);
if (isFirstTime) {
await dispatch('entities/insert', {
entity: 'workflows',
Expand Down
24 changes: 12 additions & 12 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,18 @@ if (env.NODE_ENV === 'development') {
extractComments: false,
}),
],
runtimeChunk: 'single',
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
},
},
},
// runtimeChunk: 'single',
// splitChunks: {
// chunks: 'all',
// maxInitialRequests: Infinity,
// minSize: 0,
// cacheGroups: {
// vendor: {
// test: /[\\/]node_modules[\\/]/,
// name: 'vendor',
// },
// },
// },
};
}

Expand Down

0 comments on commit e3b6016

Please sign in to comment.