Skip to content

Commit

Permalink
Various bug fixes (thomiceli#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Sep 22, 2023
1 parent a5ea522 commit 9dff67f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion internal/db/gist.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ func (gist *Gist) UpdatePreviewAndCount() error {
gist.Preview = file.Content
}

gist.Preview = file.Content
gist.PreviewFilename = file.Filename
}

Expand Down
4 changes: 3 additions & 1 deletion public/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 9dff67f

Please sign in to comment.