Skip to content

Commit

Permalink
fix: local images now load properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Oct 13, 2024
1 parent 2847eef commit 6db37e2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"fast-xml-parser": "^4.5.0",
"markdown-it": "^13.0.2",
"svelte-lazy": "^1.2.7",
"svelte-splitpanes": "^0.7.15",
"svelte-splitpanes": "8.0.8",
"svelte-tippy": "^1.3.2",
"tippy.js": "^6.3.7"
},
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"dangerousDisableAssetCspModification": [
"style-src"
],
"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost https://*.steamgriddb.com; media-src 'self' asset: https://asset.localhost https://*.steamgriddb.com; style-src 'self' 'unsafe-inline'; connect-src ipc: http://ipc.localhost"
"csp": "default-src 'self'; img-src 'self' asset: http://asset.localhost https://*.steamgriddb.com; media-src 'self' asset: http://asset.localhost https://*.steamgriddb.com; style-src 'self' 'unsafe-inline'; connect-src ipc: http://ipc.localhost"
}
},
"plugins": {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/utils/SettingsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ export class SettingsManager {
* Gets the settings data and updates it if needed.
*/
private static async loadSettingsFromSystem(): Promise<AppSettings> {
const currentSettings = JSON.parse(await fs.readTextFile(SettingsManager.settingsPath));
let currentSettings: any = {};

if (await fs.exists(SettingsManager.settingsPath)) {
currentSettings = JSON.parse(await fs.readTextFile(SettingsManager.settingsPath));
}

let settings: AppSettings = { ...currentSettings };

Expand Down

0 comments on commit 6db37e2

Please sign in to comment.