optimization and wait for all commits to load before hiding loading indicator
This commit is contained in:
@@ -97,8 +97,6 @@ class RepoViewScreen(Screen):
|
|||||||
self.app.GITEA_HOST + f"api/v1/repos/{self.owner_name}/{self.repo_name}/contents"
|
self.app.GITEA_HOST + f"api/v1/repos/{self.owner_name}/{self.repo_name}/contents"
|
||||||
)
|
)
|
||||||
|
|
||||||
loading.display = False
|
|
||||||
|
|
||||||
if not files_response.ok:
|
if not files_response.ok:
|
||||||
self.notify(files_response.text, title="Failed to get files:", severity="error")
|
self.notify(files_response.text, title="Failed to get files:", severity="error")
|
||||||
return
|
return
|
||||||
@@ -133,7 +131,7 @@ class RepoViewScreen(Screen):
|
|||||||
commits = requests.get(
|
commits = requests.get(
|
||||||
self.app.GITEA_HOST + f"api/v1/repos/{self.owner_name}/{self.repo_name}/commits",
|
self.app.GITEA_HOST + f"api/v1/repos/{self.owner_name}/{self.repo_name}/commits",
|
||||||
params={
|
params={
|
||||||
#"path": ".",
|
"path": ".",
|
||||||
"verification": False,
|
"verification": False,
|
||||||
"files": False,
|
"files": False,
|
||||||
"page": commit_page_number,
|
"page": commit_page_number,
|
||||||
@@ -161,6 +159,7 @@ class RepoViewScreen(Screen):
|
|||||||
))
|
))
|
||||||
files.add_rows(rows)
|
files.add_rows(rows)
|
||||||
|
|
||||||
|
loading.display = False
|
||||||
files.display = True
|
files.display = True
|
||||||
|
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
|
|||||||
Reference in New Issue
Block a user