mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-14 01:39:56 -05:00
Feat: Longstrip Viewer(s) & Lag Improvements
This commit is contained in:
@@ -39,6 +39,8 @@
|
||||
goto(u.toString(), { replaceState: true, noScroll: true });
|
||||
}
|
||||
|
||||
let pendingPrefill = $state("");
|
||||
|
||||
let tabsEl = $state<HTMLDivElement | undefined>(undefined);
|
||||
let tabIndicator = $state({ left: 0, width: 0 });
|
||||
|
||||
@@ -248,11 +250,13 @@
|
||||
{availableLangs}
|
||||
{hasMultipleLangs}
|
||||
{loadingSources}
|
||||
{pendingPrefill}
|
||||
popularResults={popular_results}
|
||||
popularLoading={popular_loading}
|
||||
{sourceCache}
|
||||
query={urlQuery}
|
||||
onQueryChange={setQuery}
|
||||
onPrefillConsumed={() => { pendingPrefill = ""; }}
|
||||
onPreview={(m) => setPreviewManga(m)}
|
||||
/>
|
||||
{:else if urlTab === "tag"}
|
||||
|
||||
@@ -53,7 +53,12 @@
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (tag_localHasNext && !tag_loadingMoreLocal && !tag_loadingLocal) tagLoadMoreLocal();
|
||||
const _hasNext = tag_localHasNext;
|
||||
const _loadingMore = tag_loadingMoreLocal;
|
||||
const _loadingLocal = tag_loadingLocal;
|
||||
untrack(() => {
|
||||
if (_hasNext && !_loadingMore && !_loadingLocal) tagLoadMoreLocal();
|
||||
});
|
||||
});
|
||||
|
||||
async function tagFetchLocal(activeTags: string[], tagMode: TagMode, activeStatuses: string[]) {
|
||||
@@ -191,11 +196,15 @@
|
||||
|
||||
let tag_autoSearchFired = $state(false);
|
||||
$effect(() => {
|
||||
tag_activeTags;
|
||||
tag_activeStatuses;
|
||||
const _tags = tag_activeTags;
|
||||
const _statuses = tag_activeStatuses;
|
||||
const _loadingLocal = tag_loadingLocal;
|
||||
const _hasFilters = tag_hasActiveFilters;
|
||||
const _resultLen = tag_localResults.length;
|
||||
const _cacheReady = sourceCacheReady;
|
||||
untrack(() => { tag_autoSearchFired = false; });
|
||||
if (!tag_loadingLocal && tag_hasActiveFilters && !tag_autoSearchFired && !tag_searchSources && sourceCacheReady) {
|
||||
if (tag_localResults.length < 20) {
|
||||
if (!_loadingLocal && _hasFilters && !tag_autoSearchFired && !tag_searchSources && _cacheReady) {
|
||||
if (_resultLen < 20) {
|
||||
untrack(() => { tag_autoSearchFired = true; tag_searchSources = true; });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user