Skip to content

Commit

Permalink
Fix content not appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
cochaviz committed Aug 13, 2024
1 parent 0ead9f8 commit 3e080ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dear_diary/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ window.onload = function () {
console.log(data);
input_field.value = data.content;

if (data.content) {
on_has_content();
if (!data.content) {
on_has_no_content();
}
})
.catch((error) => {
Expand All @@ -97,9 +97,9 @@ window.onload = function () {
});
}

function on_has_content() {
question_button.disabled = false;
search_button.disabled = false;
function on_has_no_content() {
question_button.disabled = true;
search_button.disabled = true;
}

function change_to_tab(name, tab_function, submit_callback) {
Expand Down Expand Up @@ -140,7 +140,7 @@ window.onload = function () {
}

// entry tab is default
change_to_tab("entry", entry_tab_settings, post_entry)();
change_to_tab("entry", entry_tab_settings, post_entry);
get_content(date);
};

Expand Down

0 comments on commit 3e080ee

Please sign in to comment.