changelog fix

This commit is contained in:
Jan Prochazka
2025-05-03 19:03:06 +02:00
parent 2e3b770bea
commit 16990bd0c3
2 changed files with 9 additions and 4 deletions

View File

@@ -298,8 +298,12 @@ module.exports = {
changelog_meta: true, changelog_meta: true,
async changelog() { async changelog() {
const resp = await axios.default.get('https://raw.githubusercontent.com/dbgate/dbgate/master/CHANGELOG.md'); try {
return resp.data; const resp = await axios.default.get('https://raw.githubusercontent.com/dbgate/dbgate/master/CHANGELOG.md');
return resp.data;
} catch (err) {
return ''
}
}, },
checkLicense_meta: true, checkLicense_meta: true,

View File

@@ -7,9 +7,10 @@
import LoadingInfo from '../elements/LoadingInfo.svelte'; import LoadingInfo from '../elements/LoadingInfo.svelte';
import Markdown from '../elements/Markdown.svelte'; import Markdown from '../elements/Markdown.svelte';
import { apiCall } from '../utility/api'; import { apiCall } from '../utility/api';
import _ from 'lodash';
let isLoading = false; let isLoading = false;
let text = null; let text = '';
const handleLoad = async () => { const handleLoad = async () => {
isLoading = true; isLoading = true;
@@ -27,7 +28,7 @@
<LoadingInfo message="Loading changelog" /> <LoadingInfo message="Loading changelog" />
{:else} {:else}
<div> <div>
<Markdown source={text || ''} /> <Markdown source={_.isString(text) ? text: ''} />
</div> </div>
{/if} {/if}