Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/scratch-gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"bowser": "1.9.4",
"classnames": "2.5.1",
"computed-style-to-inline-style": "3.0.0",
"cookie": "0.6.0",
"cookie": "^1.1.1",
"copy-webpack-plugin": "6.4.1",
"core-js": "2.6.12",
"css-loader": "5.2.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cookie from 'cookie';
import {parse} from 'cookie';

import {DEFAULT_MODE, HIGH_CONTRAST_MODE} from '.';

Expand All @@ -17,7 +17,7 @@ const systemPreferencesColorMode = () => {
};

const detectColorMode = () => {
const obj = cookie.parse(document.cookie) || {};
const obj = parse(document.cookie) || {};
const colorModeCookie = obj.scratchtheme;

if (isValidColorMode(colorModeCookie)) return colorModeCookie;
Expand Down
4 changes: 2 additions & 2 deletions packages/scratch-gui/src/lib/settings/theme/persistence.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cookie from 'cookie';
import {parse} from 'cookie';

import {DEFAULT_THEME, CAT_BLOCKS_THEME} from '.';

Expand All @@ -12,7 +12,7 @@ const isValidTheme = theme => [DEFAULT_THEME, CAT_BLOCKS_THEME].includes(theme);
// For now, we'll take the user preference here as-is and switch to default theme if needed,
// once we have the user info available.
const detectTheme = () => {
const obj = cookie.parse(document.cookie) || {};
const obj = parse(document.cookie) || {};
const themeCookie = obj[COOKIE_KEY];

if (isValidTheme(themeCookie)) return themeCookie;
Expand Down
Loading