Skip to content

Commit

Permalink
Merge pull request joerick#328 from joerick/fix-insecure-contexts
Browse files Browse the repository at this point in the history
Fix missing crypto API in some browser contexts
  • Loading branch information
joerick authored Aug 5, 2024
2 parents cabe2d2 + a7f5a0a commit fd78849
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
15 changes: 15 additions & 0 deletions html_renderer/package-lock.json

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

3 changes: 3 additions & 0 deletions html_renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"tslib": "^2.6.3",
"typescript": "^5.5.4",
"vite": "^5.3.5"
},
"dependencies": {
"uuid": "^10.0.0"
}
}
2 changes: 1 addition & 1 deletion html_renderer/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// add favicon
const favicon = document.createElement('link')
favicon.rel = 'shortut icon'
favicon.rel = 'shortcut icon'
favicon.href = faviconImage
document.head.appendChild(favicon)
Expand Down
3 changes: 2 additions & 1 deletion html_renderer/src/lib/model/Frame.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Group from './Group';
import type {FrameData} from '../dataTypes';
import { v4 as uuidv4 } from 'uuid';

export default class Frame {
uuid: string
Expand All @@ -20,7 +21,7 @@ export default class Frame {
group: Group | null;

constructor(jsonObject: FrameData, parent: Frame|null = null, context: FrameContext = {groups:{}}) {
this.uuid = crypto.randomUUID()
this.uuid = uuidv4()
this.parent = parent
this.function = jsonObject.function;
this.filePath = jsonObject.file_path;
Expand Down
3 changes: 3 additions & 0 deletions html_renderer/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'uuid' {
export function v4(): string;
}
Loading

0 comments on commit fd78849

Please sign in to comment.