From b3b403a0582da04a3f2edbf42e9bfdaa46d7baad Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 30 Apr 2020 17:09:50 -0400 Subject: [PATCH] fix deleted text file handling on desktop --- static/app-strings.json | 5 +++-- ui/constants/file_render_modes.js | 2 +- ui/index.jsx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index e3965510f..fc22083e3 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1199,5 +1199,6 @@ "Pause at any time to select a thumbnail from your video": "Pause at any time to select a thumbnail from your video", "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 mbps) and resolution (720p) for more reliable streaming.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 mbps) and resolution (720p) for more reliable streaming.", "this channel": "this channel", - "Share this channel": "Share this channel" -} + "Share this channel": "Share this channel", + "File preview": "File preview" +} \ No newline at end of file diff --git a/ui/constants/file_render_modes.js b/ui/constants/file_render_modes.js index fc1f71481..0840405d9 100644 --- a/ui/constants/file_render_modes.js +++ b/ui/constants/file_render_modes.js @@ -17,7 +17,7 @@ export const CAD = 'cad'; export const COMIC = 'comic'; // These types can only be render if download completed -export const NON_STREAM_MODES = [CAD, COMIC]; +export const NON_STREAM_MODES = IS_WEB ? [CAD, COMIC] : [CAD, COMIC, ...TEXT_MODES]; export const AUTO_RENDER_MODES = [IMAGE].concat(TEXT_MODES); export const WEB_SHAREABLE_MODES = AUTO_RENDER_MODES.concat(FLOATING_MODES); diff --git a/ui/index.jsx b/ui/index.jsx index 7f4515d86..d9270c54c 100644 --- a/ui/index.jsx +++ b/ui/index.jsx @@ -236,7 +236,7 @@ document.addEventListener('click', event => { function AppWrapper() { // Splash screen and sdk setup not needed on web - const [readyToLaunch, setReadyToLaunch] = useState(IS_WEB); + const [readyToLaunch, setReadyToLaunch] = useState(IS_WEB || sessionStorage.getItem('startup')); const [persistDone, setPersistDone] = useState(false); useEffect(() => { @@ -270,6 +270,7 @@ function AppWrapper() { useEffect(() => { if (readyToLaunch && persistDone) { + sessionStorage.setItem('startup', true); app.store.dispatch(doUpdateIsNightAsync()); app.store.dispatch(doDaemonReady()); app.store.dispatch(doBlackListedOutpointsSubscribe());