From 5151ff9584e000c35ff2746a6938cb727560c039 Mon Sep 17 00:00:00 2001 From: rohvsh Date: Sat, 3 Sep 2016 02:25:04 +0530 Subject: [PATCH] Ensure nacl fs is ready before copying files --- iguana/example.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/iguana/example.js b/iguana/example.js index d8d59f6a8..d2a5b1b69 100755 --- a/iguana/example.js +++ b/iguana/example.js @@ -121,18 +121,13 @@ function domContentLoaded(name, tc, config, width, height) { window.requestFileSystem(PERSISTENT, bytes, function(fs) { console.log('Opened file system: ' + fs.name); fileSystem = fs; - copyHelpFiles().done(function() { - common.updateStatus( + common.updateStatus( 'Allocated ' + bytes + ' bytes of persistent storage. Running the first time will take 17 seconds to load'); common.attachDefaultListeners(); common.createNaClModule(name, tc, config, width, height); - }); - /*dirReader = fs.root.createReader(); - dirReader.readEntries(function(results) { - console.log(results); - }, function(){ - console.log('File IO error'); - });*/ + setTimeout(function(){ + copyHelpFiles(); + },2000); }, errorHandler); }, function(e) {