diff --git a/src/resources/icons/FALLBACK_BG.jpg b/src/resources/icons/FALLBACK_BG.jpg new file mode 100644 index 0000000..f7c9f21 Binary files /dev/null and b/src/resources/icons/FALLBACK_BG.jpg differ diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 9e00a9b..d971e79 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -8,6 +8,9 @@ import { convertFileSrc, invoke } from '@tauri-apps/api/tauri' import { Main } from './Main' import { Mods } from './Mods' +// From https://www.pixiv.net/en/artworks/93995273 +import FALLBACK_BG from '../resources/icons/FALLBACK_BG.jpg' + interface IState { page: string bgFile: string @@ -64,6 +67,18 @@ class App extends React.Component, IState> { this.forceUpdate ) } + } else { + // Check if api bg is accessible + const isDefaultValid = await invoke('valid_url', { + url: DEFAULT_BG, + }) + + this.setState( + { + bgFile: isDefaultValid ? DEFAULT_BG : FALLBACK_BG, + }, + this.forceUpdate + ) } window.addEventListener('changePage', (e) => { diff --git a/src/ui/Main.tsx b/src/ui/Main.tsx index 19967d0..5886aca 100644 --- a/src/ui/Main.tsx +++ b/src/ui/Main.tsx @@ -112,6 +112,10 @@ export class Main extends React.Component { await setConfigOption('cert_generated', true) } + // Ensure old configs are updated to use RSA + const updatedConfig = await getConfigOption('patch_rsa') + await setConfigOption('patch_rsa', updatedConfig) + // Period check to only show progress bar when downloading files setInterval(() => { this.setState({