Skip to content

Commit

Permalink
fix(all): client types and theme stuff if config is corrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Sep 2, 2023
1 parent e8d5416 commit d1da03a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src-tauri/injection/preinject.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ function safemodeTimer(elm) {
await displayLoadingTop()

const { invoke, event } = window.__TAURI__
let config = JSON.parse(await invoke('read_config_file')) || null
let config = {}

try {
config = JSON.parse(await invoke('read_config_file'))
} catch(e) {
console.log('Error reading config.')
}

window.DorionConfig = config

Expand Down Expand Up @@ -102,7 +108,7 @@ function safemodeTimer(elm) {
// Get theme if it exists
let themeInjection = ''

if (config.theme !== 'none') {
if (config.theme && config.theme !== 'none') {
if (midtitle) midtitle.innerHTML = "Loading theme CSS..."

const themeContents = await invoke('get_theme', {
Expand Down

0 comments on commit d1da03a

Please sign in to comment.