Loading indicator for search page in web app
This commit is contained in:
1 parent
093953c113
commit
25eccde5c3
2 files changed
+16
-2
No files matched your search
+2
-1
@@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- links to the app info in web app
|
- Links to the app info in web app
|
||||||
|
- Loading indicator for search page in web app
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
let suggestions: { suggestions: any[] } = { suggestions: [] };
|
let suggestions: { suggestions: any[] } = { suggestions: [] };
|
||||||
let videos = [];
|
let videos = [];
|
||||||
let searchHistory = [];
|
let searchHistory = [];
|
||||||
|
let isLoading = false;
|
||||||
|
|
||||||
playletStateStore.subscribe((value) => {
|
playletStateStore.subscribe((value) => {
|
||||||
invidiousApi.instance = value?.invidious?.current_instance;
|
invidiousApi.instance = value?.invidious?.current_instance;
|
||||||
@@ -76,7 +77,13 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
videos = await invidiousApi.search(searchBoxText);
|
try {
|
||||||
|
isLoading = true;
|
||||||
|
videos = await invidiousApi.search(searchBoxText);
|
||||||
|
} finally {
|
||||||
|
isLoading = false;
|
||||||
|
}
|
||||||
|
|
||||||
const newSearchHistory = await PlayletApi.putSearchHistory(searchBoxText);
|
const newSearchHistory = await PlayletApi.putSearchHistory(searchBoxText);
|
||||||
searchHistoryStore.set(newSearchHistory);
|
searchHistoryStore.set(newSearchHistory);
|
||||||
}
|
}
|
||||||
@@ -134,6 +141,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
{#if isLoading}
|
||||||
|
<div class="fixed w-full h-1/2 z-50 flex justify-center items-center">
|
||||||
|
<span class="loading loading-spinner loading-md" />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="grid grid-flow-row-dense gap-4 items-center justify-center sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 m-4"
|
class="grid grid-flow-row-dense gap-4 items-center justify-center sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 m-4"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user