diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9f4f363..3202c4b 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -15,7 +15,7 @@ const App: Component = (props: ParentProps): JSX.Element => {
- {props.children} + {props.children}
diff --git a/frontend/src/AppContext.ts b/frontend/src/AppContext.ts index 2170f82..11a8670 100644 --- a/frontend/src/AppContext.ts +++ b/frontend/src/AppContext.ts @@ -1,5 +1,9 @@ import {PasteView} from './api/model/PasteView'; -import {PasteClone} from './components/CreatePaste/CreatePaste'; + +export type PasteClone = { + title?: string + content: string +} export interface IAppContext { pushPasteCloned: (data: PasteClone) => void @@ -24,9 +28,9 @@ class AppContextImpl implements IAppContext { } popPasteCloned() : PasteClone | undefined { - const holder = this.pasteCloned; + const ref = this.pasteCloned; delete this.pasteCloned; - return holder; + return ref; } pushPasteCreated(paste: PasteView) { @@ -35,9 +39,9 @@ class AppContextImpl implements IAppContext { } popPasteCreated() : PasteView | undefined { - const holder = this.pasteCreated; + const ref = this.pasteCreated; delete this.pasteCreated; - return holder; + return ref; } onPasteCreated(callback: (paste: PasteView) => void) { diff --git a/frontend/src/components/CreatePaste/CreatePaste.tsx b/frontend/src/components/CreatePaste/CreatePaste.tsx index 2aa0349..ada5ef7 100644 --- a/frontend/src/components/CreatePaste/CreatePaste.tsx +++ b/frontend/src/components/CreatePaste/CreatePaste.tsx @@ -3,13 +3,9 @@ import {createStore} from "solid-js/store"; import {PasteCreateCmd} from "../../api/model/PasteCreateCmd"; import {encrypt} from "../../crypto/CryptoUtil"; import {CopyToClipboard} from "../../assets/Vectors"; +import {PasteClone} from "../../src/AppContext"; import styles from "./createPaste.module.css"; -export type PasteClone = { - title?: string - content: string -} - type CreatePasteProps = { onCreatePaste: (paste: PasteCreateCmd) => Promise initialPaste?: PasteClone