File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -302,8 +302,6 @@ async function loadExplore() {
302302 }
303303}
304304
305- const iconUrls = new Map ( ) ;
306-
307305async function listInstalledPlugins ( ) {
308306 let dirItems ;
309307
@@ -332,24 +330,8 @@ async function listInstalledPlugins() {
332330 }
333331
334332 try {
335- const iconUrl = getLocalRes ( id , plugin . icon ) ;
336- if ( iconUrls . has ( iconUrl ) ) {
337- URL . revokeObjectURL ( iconUrls . get ( iconUrl ) ) ;
338- iconUrls . delete ( iconUrl ) ;
339- }
340-
341- if ( await internalFs . exists ( iconUrl ) ) {
342- const fileContent = await internalFs . readFileRaw ( iconUrl ) ;
343- const ext = Url . extname ( iconUrl ) ;
344- const mime = mimeType . lookup ( ext ) ;
345- const blob = new Blob ( [ fileContent . data ] , { type : mime } ) ;
346- const url = URL . createObjectURL ( blob ) ;
347- plugin . icon = url ;
348- iconUrls . set ( iconUrl , url ) ;
349- } else {
350- console . error ( `File path ${ iconUrl } doesnt exists` ) ;
351- plugin . icon = null ;
352- }
333+ const iconUrl = Capacitor . convertFileSrc ( getLocalRes ( id , plugin . icon ) ) ;
334+ plugin . icon = iconUrl ;
353335 } catch ( err ) {
354336 plugin . icon = null ;
355337 }
You can’t perform that action at this time.
0 commit comments