Various bug fixes (#105)

This commit is contained in:
Thomas Miceli 2023-09-22 17:31:19 +02:00 committed by GitHub
parent a5ea522e45
commit 9dff67f003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -377,7 +377,6 @@ func (gist *Gist) UpdatePreviewAndCount() error {
gist.Preview = file.Content
}
gist.Preview = file.Content
gist.PreviewFilename = file.Filename
}

View file

@ -11,7 +11,9 @@ const setSetting = (key: string, value: string) => {
const data = new URLSearchParams();
data.append('key', key);
data.append('value', value);
data.append('_csrf', ((document.getElementsByName('_csrf')[0] as HTMLInputElement).value));
if (document.getElementsByName('_csrf').length !== 0) {
data.append('_csrf', ((document.getElementsByName('_csrf')[0] as HTMLInputElement).value));
}
return fetch('/admin-panel/set-config', {
method: 'PUT',
credentials: 'same-origin',