tutorial-photo-gallery-vue icon indicating copy to clipboard operation
tutorial-photo-gallery-vue copied to clipboard

replace line convertBlobToBase64 (vue tutorial) with base64FromPath (react tutorial)

Open ulf1 opened this issue 3 years ago • 0 comments

https://github.com/ionic-team/tutorial-photo-gallery-vue/blob/d7e0f0bdb3f4326f3cb0a2f4d6b374dfe9c682d1/src/composables/usePhotoGallery.ts#L64

Line 64 causes TS errors TS2352: Conversion of type 'void' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.

Cause: convertBlobToBase64 (https://github.com/ionic-team/tutorial-photo-gallery-vue/blob/main/src/composables/usePhotoGallery.ts#L37) doesn't specify string as promise output type

Fix:

  • Use the code from the React tutorial
  • Delete line 37-45 and line 62-64
  • Copy the function base64FromPath from line 112 https://github.com/ionic-team/tutorial-photo-gallery-react/blob/009dceb500144d20bc4a2c45e3a95c256eacec93/src/hooks/usePhotoGallery.ts#L112
  • Copy the base64Data = await base64FromPath(photo.webPath!); from 58 https://github.com/ionic-team/tutorial-photo-gallery-react/blob/009dceb500144d20bc4a2c45e3a95c256eacec93/src/hooks/usePhotoGallery.ts#L58

ulf1 avatar Dec 23 '22 10:12 ulf1