Skip to content

Commit 104e3c2

Browse files
committed
optimise 🌳 imports
1 parent 5920bf7 commit 104e3c2

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/api/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const IS_DEV = __development__;
22
export const APPLICATION_VERSION = __app_version__;
3-
export const APPLICATION_NAME = `${__app_name__}@${__app_version__}`;
3+
export const APPLICATION_NAME = __app_name__;
44
export const APPLICATION_HOME_PAGE = __home_page__;

src/api/settings.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { cloneObjectSafely } from '@/api/clone.ts';
2-
31
type TPanelKey =
42
| 'eval'
53
| 'media'
@@ -118,13 +116,13 @@ export function panelsArrayToVisibilityMap(panels: TSettingsPanel[]) {
118116
}
119117

120118
export async function getSettings(): Promise<typeof DEFAULT_SETTINGS> {
121-
const store = await chrome.storage.local.get([SETTINGS_VERSION]);
119+
let store = await chrome.storage.local.get([SETTINGS_VERSION]);
122120
const isEmpty = !Object.keys(store).length;
123121

124122
if (isEmpty) {
125-
store[SETTINGS_VERSION] = cloneObjectSafely(DEFAULT_SETTINGS);
126123
await chrome.storage.local.clear(); // rid off previous version settings
127-
await chrome.storage.local.set(store);
124+
await chrome.storage.local.set({ [SETTINGS_VERSION]: DEFAULT_SETTINGS });
125+
store = await chrome.storage.local.get([SETTINGS_VERSION]);
128126
}
129127

130128
return store[SETTINGS_VERSION];

webpack.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function (
3737
plugins: [
3838
new webpack.DefinePlugin({
3939
__development__: `${!isProd}`,
40-
__app_name__: `"browser-api-monitor"`,
40+
__app_name__: `"browser-api-monitor@${manifest.version}"`,
4141
__app_version__: `"${manifest.version}"`,
4242
__home_page__: `"${manifest.homepage_url}"`,
4343
}),

0 commit comments

Comments
 (0)