fix: do not show entity list when open page

This commit is contained in:
arkohut 2024-10-14 17:52:50 +08:00
parent c31c89374a
commit f3d6877e71
2 changed files with 14 additions and 16 deletions

View File

@ -497,7 +497,7 @@ async def vec_search(
if start is not None and end is not None:
sql_query += (
" AND strftime('%s', entities.file_created_at) BETWEEN :start AND :end"
" AND strftime('%s', entities.file_created_at, 'utc') BETWEEN :start AND :end"
)
params["start"] = str(start)
params["end"] = str(end)
@ -588,7 +588,7 @@ async def list_entities(
if start is not None and end is not None:
query = query.filter(
func.strftime("%s", EntityModel.file_created_at).between(
func.strftime("%s", EntityModel.file_created_at, 'utc').between(
str(start), str(end)
)
)

View File

@ -19,8 +19,8 @@
let showModal = false;
let selectedImage = 0;
let startTimestamp = -1;
let endTimestamp = -1;
let startTimestamp: number | null = null;
let endTimestamp: number | null = null;
let selectedLibraries: number[] = [];
let searchResult: SearchResult | null = null;
@ -169,21 +169,19 @@
}
function handleFiltersChange() {
if (searchString.trim()) {
searchItems(
searchString,
startTimestamp,
endTimestamp,
selectedLibraries,
Object.keys(selectedTags).filter((tag) => selectedTags[tag]),
Object.keys(selectedDates).filter((date) => selectedDates[date]),
false
);
}
searchItems(
searchString,
startTimestamp,
endTimestamp,
selectedLibraries,
Object.keys(selectedTags).filter((tag) => selectedTags[tag]),
Object.keys(selectedDates).filter((date) => selectedDates[date]),
false
);
}
$: {
if (startTimestamp !== -1 || endTimestamp !== -1 || selectedLibraries.length > 0) {
if (startTimestamp != null || endTimestamp != null || selectedLibraries.length > 0) {
handleFiltersChange();
}
}