File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ if (!file_ref) {
105105
106106// Read the contents of the file.
107107const file_reader = new FileReader ();
108- file_reader .onload = (event ) => {
108+ file_reader .onload = async (event ) => {
109109 // File contents will appear in event.target.result. See
110110 // https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onload for
111111 // more info.
@@ -170,7 +170,7 @@ if (file_ref) {
170170let file_id = " 123" ; // Some logic to determine which file you'd like to open
171171let transaction = db .transaction ([" filerefs" ], " readonly" );
172172let request = transaction .objectStore (" filerefs" ).get (file_id);
173- request .onsuccess = function (e ) {
173+ request .onsuccess = async function (e ) {
174174 let ref = e .result ;
175175
176176 // Permissions for the handle may have expired while the handle was stored
@@ -197,7 +197,7 @@ The fact that handles are serializable also means you can `postMessage` them aro
197197
198198``` javascript
199199// In a service worker:
200- self .addEventListener (' some-hypothetical-launch-event' , e => {
200+ self .addEventListener (' some-hypothetical-launch-event' , async ( e ) => {
201201 // e.file is a FileSystemFileHandle representing the file this SW was launched with.
202202 let win = await clients .openWindow (' bla.html' );
203203 if (win)
You can’t perform that action at this time.
0 commit comments