firescript / nativescript-contacts

A nativescript module that gives access to the native contact directory.
MIT License
28 stars 32 forks source link

Fix #33 #50

Closed nickykln closed 5 years ago

nickykln commented 5 years ago

Hello, I fixed this issue while compiling with Web Pack. #33

Nicolas

firescript commented 5 years ago

Thanks @nickykln can you explain what is different here? I just went through it. Was hard to notice anything different besides formatting changes. Please just let me know where you made changes.

Did you just put these changes in? https://github.com/firescript/nativescript-contacts/issues/33#issuecomment-411483106

nickykln commented 5 years ago

Hi @firescript

Sorry for the formatting differences.

Actually I just implemented the fix explained by DeepakArora76 in the comment of #33

Replace the following lines in the files index.ios.js and index.andriod.js

exports.getAllContacts = function(contactFields) { return new Promise(function (resolve, reject) { var worker = new Worker('./get-all-contacts-worker.js');

exports.getAllContacts = function(contactFields) { return new Promise(function (resolve, reject) { var worker; // Check if webpack is used, in which case, load using webpack loader, otherwise load using relative path // Using webpack assumes that the nativescript worker loader is properly configured. See https://github.com/NativeScript/worker-loader if (global["TNS_WEBPACK"]) { var myWorker = require('nativescript-worker-loader!./get-all-contacts-worker.js'); worker = new myWorker(); } else { worker = new Worker('./get-all-contacts-worker.js'); // relative for caller script path }

Do you want me to make another pull request or you prefer to do it yourself ?

Thanks,

Nicolas

nickykln commented 5 years ago

Hi @firescript,

Did you have time to review this pull request ? Let me know if you want me to clear the formating issue ?

thnaks,

Nicolas

firescript commented 5 years ago

thanks @nickykln