Skip to content

Commit

Permalink
mobile: update namespace of permission enums
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulMelody committed Mar 1, 2025
1 parent 143aca1 commit 70a86a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libresvip/mobile/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,12 @@ def on_upload_progress(e: ft.FilePickerUploadEvent) -> None:
page.overlay.extend([file_picker, permission_handler])

def check_permission(e: ft.ControlEvent) -> None:
result = permission_handler.check_permission(e.control.data)
result: fph.PermissionStatus | None = permission_handler.check_permission(e.control.data)
banner_ref = ft.Ref[ft.Banner]()
dismiss_btn = ft.TextButton(text=_("OK"), on_click=lambda _: page.close(banner_ref.current))
if result != ft.PermissionStatus.GRANTED:
if result != fph.PermissionStatus.GRANTED:
result = permission_handler.request_permission(e.control.data)
if result == ft.PermissionStatus.GRANTED:
if result == fph.PermissionStatus.GRANTED:
banner = ft.Banner(
ft.Text(_("Permission granted, you can now select files from your device.")),
ref=banner_ref,
Expand Down Expand Up @@ -1104,7 +1104,7 @@ def select_page(e: ft.ControlEvent) -> None:
),
ft.ElevatedButton(
_("Request permission to access files"),
data=ft.PermissionType.MANAGE_EXTERNAL_STORAGE,
data=fph.PermissionType.MANAGE_EXTERNAL_STORAGE,
on_click=check_permission,
col=12,
),
Expand Down

0 comments on commit 70a86a3

Please sign in to comment.