From fb1dbd75d4bf5005624531f3d939c1a1541c3393 Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 3 Apr 2022 19:47:01 +0100 Subject: [PATCH] Read-only mode only if content is loaded --- src/App.js | 1 + src/components/Editor.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 94bb9bb..97f2cb8 100644 --- a/src/App.js +++ b/src/App.js @@ -83,6 +83,7 @@ export default function App() { actualContent={actualContent} setActualContent={setActualContent} contentType={contentType} + pasteId={pasteId} /> ); } diff --git a/src/components/Editor.js b/src/components/Editor.js index 93a21a6..e4ad099 100644 --- a/src/components/Editor.js +++ b/src/components/Editor.js @@ -13,9 +13,10 @@ export default function Editor({ actualContent, setActualContent, contentType, + pasteId, }) { const [language, setLanguage] = useState('plain'); - const [readOnly, setReadOnly] = useState(isMobile); + const [readOnly, setReadOnly] = useState(isMobile && pasteId); const [theme, setTheme] = usePreference( 'theme',