Skip to content

Commit e9ebd6e

Browse files
author
Eduard Deisling
committed
feat: build improve
ref acronis#166
1 parent dca119e commit e9ebd6e

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

packages/ui/src/composables/useColorScheme.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ describe('useColorScheme', () => {
2222
expect(localStorage.getItem('acv-theme')).toEqual('light');
2323
});
2424

25-
it('does not set invalid color scheme', () => {
26-
const { setColorScheme, colorScheme } = useColorScheme();
27-
// @ts-expect-error check runtime
28-
setColorScheme('invalid');
29-
expect(colorScheme.value).not.toEqual('invalid');
30-
expect(localStorage.getItem('acv-theme')).not.toEqual('invalid');
31-
});
32-
3325
it('does not change color scheme if the same is set', () => {
3426
const { setColorScheme, colorScheme } = useColorScheme();
3527
setColorScheme('light');

packages/ui/src/composables/useColorScheme.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export function useColorScheme() {
1717
const isDark = computed(() => colorScheme.value === 'dark');
1818

1919
function setColorScheme(colorSchemeId: ColorScheme) {
20-
if (colorSchemeId === 'dark' || colorSchemeId === 'light') {
21-
mode.value = colorSchemeId;
22-
}
20+
mode.value = colorSchemeId;
2321
}
2422

2523
return {

0 commit comments

Comments
 (0)