[PR #2528] fix(mobile): replace deprecated ImagePicker.MediaTypeOptions with media type literal #2142

Open
opened 2026-03-02 12:00:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/2528
Author: @esimkowitz
Created: 2/27/2026
Status: 🔄 Open

Base: mainHead: fix/photo-library-deprecated-api


📝 Commits (2)

  • c9c0ba4 fix(mobile): replace deprecated MediaTypeOptions with media type literal and add error handling
  • 26fc038 address comments

📊 Changes

1 file changed (+36 additions, -12 deletions)

View changed files

📝 apps/mobile/app/dashboard/(tabs)/(home)/index.tsx (+36 -12)

📄 Description

Summary

  • Replace deprecated ImagePicker.MediaTypeOptions.Images enum with the v17 ["images"] media type literal array
  • Wrap launchImageLibraryAsync in try/catch to handle permission denials and system errors
  • Guard result.assets[0] before accessing properties
  • Show a failure toast via sonnerToast.error on catch, clearing uploadToastIdRef if set

Test plan

  • Open app → tap Plus → Photo Library → pick an image → verify upload succeeds
  • Deny photo library permission → tap Photo Library → verify error toast appears
  • Verify no deprecation warning in console for MediaTypeOptions

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karakeep-app/karakeep/pull/2528 **Author:** [@esimkowitz](https://github.com/esimkowitz) **Created:** 2/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/photo-library-deprecated-api` --- ### 📝 Commits (2) - [`c9c0ba4`](https://github.com/karakeep-app/karakeep/commit/c9c0ba4a714061ec044ce182b7e4114dd93ffdcf) fix(mobile): replace deprecated MediaTypeOptions with media type literal and add error handling - [`26fc038`](https://github.com/karakeep-app/karakeep/commit/26fc038ecaae7a45ed48839d4ffe5f0ba160c71e) address comments ### 📊 Changes **1 file changed** (+36 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `apps/mobile/app/dashboard/(tabs)/(home)/index.tsx` (+36 -12) </details> ### 📄 Description ## Summary - Replace deprecated `ImagePicker.MediaTypeOptions.Images` enum with the v17 `["images"]` media type literal array - Wrap `launchImageLibraryAsync` in try/catch to handle permission denials and system errors - Guard `result.assets[0]` before accessing properties - Show a failure toast via `sonnerToast.error` on catch, clearing `uploadToastIdRef` if set ## Test plan - [ ] Open app → tap Plus → Photo Library → pick an image → verify upload succeeds - [ ] Deny photo library permission → tap Photo Library → verify error toast appears - [ ] Verify no deprecation warning in console for `MediaTypeOptions` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#2142
No description provided.