mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-19 21:33:41 -05:00
fix a config corruption bug
This commit is contained in:
parent
d1d64ab954
commit
bb733c8a9c
3 changed files with 10 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
|||
## 1.5.6
|
||||
|
||||
### Fixes
|
||||
* fix config file having extra data due to a request sending twice
|
||||
|
||||
## 1.5.5
|
||||
|
||||
### Fixes
|
||||
|
|
|
@ -5,6 +5,6 @@ blacklistFile = 'word_blacklist.txt'
|
|||
configFile = 'config.json'
|
||||
faviconDir = Path.cwd() / 'static' / 'icons' / 'favicon'
|
||||
appName = 'CatAsk'
|
||||
version = '1.5.5'
|
||||
version = '1.5.6'
|
||||
# id (identifier) is to be interpreted as described in https://semver.org/#spec-item-9
|
||||
version_id = '-alpha'
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<a class="visually-hidden-focusable" href="#preview">Skip to preview</a>
|
||||
<div class="row">
|
||||
<div class="col mw-100">
|
||||
<form hx-trigger="click from:#saveConfig" hx-post="{{ url_for('api.updateConfig') }}" hx-target="#response-container" hx-swap="none">
|
||||
<form hx-post="{{ url_for('api.updateConfig') }}" hx-target="#response-container" hx-swap="none">
|
||||
<h2 id="instance" class="mb-3 fw-normal d-flex align-items-center justify-content-between">
|
||||
Instance
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-toggle="collapse" data-bs-target="#preview-collapse" aria-expanded="true" aria-controls="preview-collapse"><i class="bi bi-arrows-expand-vertical me-1"></i> Toggle preview</button>
|
||||
|
@ -59,7 +59,7 @@
|
|||
</form>
|
||||
<h2 id="customize" class="mb-3 fw-normal">Customize</h2>
|
||||
<h3 class="fw-light">Favicon</h3>
|
||||
<form hx-trigger="click from:#saveFavicon, keyup[ctrlKey&&key=='Enter']" hx-post="{{ url_for('api.uploadFavicon') }}" hx-target="#response-container" hx-swap="none" hx-encoding="multipart/form-data">
|
||||
<form hx-post="{{ url_for('api.uploadFavicon') }}" hx-target="#response-container" hx-swap="none" hx-encoding="multipart/form-data">
|
||||
<p class="m-0">Current favicon: <img src="{{ url_for('static', filename='icons/favicon/apple-touch-icon.png') }}" width="32" height="32" alt="{{ cfg.instance.title }}'s icon" class="rounded"></p>
|
||||
<div>
|
||||
<label for="favicon" class="form-label">Upload favicon</label>
|
||||
|
@ -73,7 +73,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<form hx-trigger="click from:#saveConfig, keyup[ctrlKey&&key=='Enter']" hx-post="{{ url_for('api.updateConfig') }}" hx-target="#response-container" hx-swap="none">
|
||||
<form hx-post="{{ url_for('api.updateConfig') }}" hx-target="#response-container" hx-swap="none">
|
||||
<h3 class="fw-light">Accent color</h3>
|
||||
{# <h4 class="fw-light">Color</h4> #}
|
||||
<div class="form-group d-flex flex-column">
|
||||
|
@ -220,7 +220,7 @@
|
|||
</div>
|
||||
</form>
|
||||
<hr class="mt-4 mb-4">
|
||||
<form hx-trigger="click from:#save-blacklist, keyup[ctrlKey&&key=='Enter']" hx-post="{{ url_for('admin.index') }}" hx-target="#response-container" hx-swap="none">
|
||||
<form hx-post="{{ url_for('admin.index') }}" hx-target="#response-container" hx-swap="none">
|
||||
<input type="hidden" name="action" value="update_word_blacklist">
|
||||
<div class="form-group mb-3">
|
||||
<label class="form-label" for="blacklist_cat"><h2 id="blacklist" class="fw-normal">Word blacklist</h2></label>
|
||||
|
@ -313,7 +313,6 @@
|
|||
const forms = document.querySelectorAll('form');
|
||||
forms.forEach((form) => {
|
||||
form.addEventListener('htmx:afterRequest', function(event) {
|
||||
console.log("reached event listener");
|
||||
const jsonResponse = event.detail.xhr.response;
|
||||
if (jsonResponse) {
|
||||
const parsed = JSON.parse(jsonResponse);
|
||||
|
|
Loading…
Add table
Reference in a new issue