Skip to content

Commit

Permalink
Merge pull request #183 from BinaryStudioAcademy/fix/OV-182-fix-crypt…
Browse files Browse the repository at this point in the history
…o-error

OV-182: Fix crypto error
  • Loading branch information
sofiia-trokhymchuk authored Sep 6, 2024
2 parents 0a6b9d3 + 8f0ed4d commit f2bc240
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
3 changes: 2 additions & 1 deletion frontend/src/bundles/studio/mocks/mock.helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { secondsToMilliseconds } from 'date-fns';
import { v4 as uuidv4 } from 'uuid';

import { type TimelineItem, type TimelineRows } from '../types/types.js';

Expand All @@ -9,7 +10,7 @@ const generateMockItems = (
return Array.from({ length: count })
.fill(0)
.map(() => ({
id: self.crypto.randomUUID(),
id: uuidv4(),
duration,
}));
};
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/bundles/studio/store/slice.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createSlice } from '@reduxjs/toolkit';
import { type PayloadAction } from '@reduxjs/toolkit';
import { v4 as uuidv4 } from 'uuid';

import { DataStatus, VideoPreview } from '~/bundles/common/enums/enums.js';
import {
Expand Down Expand Up @@ -34,7 +35,7 @@ const { reducer, actions, name } = createSlice({
reducers: {
addScript(state, action: PayloadAction<string>) {
const script = {
id: self.crypto.randomUUID(),
id: uuidv4(),
text: action.payload,
};

Expand Down
28 changes: 25 additions & 3 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@commitlint/cli": "19.4.0",
"@commitlint/config-conventional": "19.2.2",
"@ls-lint/ls-lint": "2.2.3",
"@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "6.19.1",
"danger": "12.3.3",
"editorconfig-checker": "5.1.8",
Expand All @@ -54,5 +55,8 @@
"simple-git-hooks": {
"pre-commit": "npx lint-staged",
"commit-msg": "npx commitlint --edit $1"
},
"dependencies": {
"uuid": "10.0.0"
}
}

0 comments on commit f2bc240

Please sign in to comment.