fix: ext short description for pre-installed extensions (#1744)

* fix: update `installed_extensions` entry after the ext has been unzipped

* fix: show installedRelease description as fallback
This commit is contained in:
Vlad Stan
2023-05-26 10:48:40 +01:00
committed by GitHub
parent 6bbebe0cee
commit af660fec14
2 changed files with 7 additions and 5 deletions
+5 -4
View File
@@ -154,7 +154,7 @@ async def check_installed_extensions(app: FastAPI):
for ext in installed_extensions:
try:
installed = check_installed_extension(ext)
installed = check_installed_extension_files(ext)
if not installed:
await restore_installed_extension(app, ext)
logger.info(
@@ -187,13 +187,11 @@ async def build_all_installed_extensions_list() -> List[InstallableExtension]:
id=ext_id, name=ext_id, installed_release=release, icon=release.icon
)
installed_extensions.append(ext_info)
await add_installed_extension(ext_info)
await update_installed_extension_state(ext_id=ext_id, active=True)
return installed_extensions
def check_installed_extension(ext: InstallableExtension) -> bool:
def check_installed_extension_files(ext: InstallableExtension) -> bool:
if ext.has_installed_version:
return True
@@ -209,6 +207,9 @@ def check_installed_extension(ext: InstallableExtension) -> bool:
async def restore_installed_extension(app: FastAPI, ext: InstallableExtension):
await add_installed_extension(ext)
await update_installed_extension_state(ext_id=ext.id, active=True)
extension = Extension.from_installable_ext(ext)
register_ext_routes(app, extension)
+2 -1
View File
@@ -108,7 +108,8 @@
class="text-subtitle2 gt-sm"
style="font-size: 11px; height: 34px"
>
{{ extension.shortDescription }}
{{ extension.shortDescription ||
extension.installedRelease?.description }}
</div>
<div class="text-subtitle1 lt-md q-mt-sm q-mb-xs">
{{ extension.name }}