From cab8a636f00b4b3d4c7629097997313263ff6f93 Mon Sep 17 00:00:00 2001 From: benweet Date: Sun, 2 Feb 2014 19:24:29 +0000 Subject: [PATCH] Fixed import documents when account is not linked to Google Drive. Fixes #299 --- public/res/providers/gdriveProviderBuilder.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/res/providers/gdriveProviderBuilder.js b/public/res/providers/gdriveProviderBuilder.js index 97c2db04..d2b51cfa 100644 --- a/public/res/providers/gdriveProviderBuilder.js +++ b/public/res/providers/gdriveProviderBuilder.js @@ -507,9 +507,14 @@ define([ $('#input-sync-export-' + providerId + '-realtime').change(function() { $fileIdInputElt.prop('disabled', $realtimeCheckboxElt.prop('checked')); }); - + + // Skip gdrive action if provider is not enabled in the settings + if(accountIndex >= settings.gdriveMultiAccount) { + return; + } var state = utils.retrieveIgnoreError(providerId + ".state"); - if(state === undefined || state.userId != storage[accountId + '.userId']) { + var userId = storage[accountId + '.userId']; + if(state === undefined || (userId && state.userId != userId)) { return; } storage.removeItem(providerId + ".state");