Skip to content

Commit e51ff82

Browse files
authored
Merge pull request #429 from mashmatrix/use-nonsecure-nanoid
use non-secure version of nanoid to avoid missing crypto global in IE11
2 parents 11a775f + 44b3228 commit e51ff82

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"scripts": {
2525
"storybook": "start-storybook -s ./node_modules/@salesforce-ux/design-system -p 9001 -c .storybook",
2626
"test": "echo \"no test to run\"",
27-
"pretest:visual": "storycap --serverCmd \"npm run storybook -- --ci\" http://localhost:9001 -o images --serverTimeout 3600000 --captureTimeout 10000 --delay 2000",
27+
"pretest:visual": "storycap --serverCmd \"NODE_ENV=test npm run storybook -- --ci\" http://localhost:9001 -o images --serverTimeout 3600000 --captureTimeout 10000 --delay 2000",
2828
"test:visual": "reg-suit -v run",
2929
"type-check": "tsc --noEmit",
3030
"type-check:watch": "npm run type-check -- --watch",

src/scripts/Datepicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Calendar = {
5050
function createCalendarObject(date?: string, mnDate?: string, mxDate?: string) {
5151
let minDate;
5252
let maxDate;
53-
let d = dayjs(date, 'YYYY-MM-DD');
53+
let d = dayjs(date ?? null, 'YYYY-MM-DD');
5454
if (!d.isValid()) {
5555
d = dayjs(getToday(), 'YYYY-MM-DD');
5656
}

src/scripts/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { nanoid } from 'nanoid';
1+
import { nanoid } from 'nanoid/non-secure';
22
import { updateScroll } from 'react-relative-portal';
33

44
export const generateUniqueId: () => string =
55
process.env.NODE_ENV === 'test' ? () => '$uuid$' : nanoid;
66

77
export const getToday =
88
process.env.NODE_ENV === 'test'
9-
? () => '2017-02-23'
9+
? () => '2022-05-18'
1010
: () => new Date().toISOString().substring(0, 10);
1111

1212
let assetRoot = '/assets';

0 commit comments

Comments
 (0)