From 2604b3a8423faf11664d511bb936bb9f774b2979 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 3 Dec 2018 15:19:07 +0100 Subject: [PATCH] remove chromeCloudStorageSync --- src/app.js | 5 -- src/app/files/chromeCloudStorageSync.js | 64 ------------------------- 2 files changed, 69 deletions(-) delete mode 100644 src/app/files/chromeCloudStorageSync.js diff --git a/src/app.js b/src/app.js index 773352f089..7c30630fca 100644 --- a/src/app.js +++ b/src/app.js @@ -21,7 +21,6 @@ var helper = require('./lib/helper') var Storage = remixLib.Storage var Browserfiles = require('./app/files/browser-files') var BrowserfilesTree = require('./app/files/browser-files-tree') -var chromeCloudStorageSync = require('./app/files/chromeCloudStorageSync') var SharedFolder = require('./app/files/shared-folder') var Config = require('./config') var Renderer = require('./app/ui/renderer') @@ -540,10 +539,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } }) - // chrome app - window.syncStorage = chromeCloudStorageSync - chromeCloudStorageSync() - var loadingFromGist = self.loadFromGist(queryParams.get()) if (!loadingFromGist) { // insert ballot contract if there are no files to show diff --git a/src/app/files/chromeCloudStorageSync.js b/src/app/files/chromeCloudStorageSync.js deleted file mode 100644 index e12acb5e09..0000000000 --- a/src/app/files/chromeCloudStorageSync.js +++ /dev/null @@ -1,64 +0,0 @@ -/* global chrome */ -'use strict' -var modalDialogCustom = require('../ui/modal-dialog-custom') - -module.exports = function (filesProviders) { - if (typeof chrome === 'undefined' || !chrome || !chrome.storage || !chrome.storage.sync) { - return - } - - var obj = {} - var done = false - var count = 0 - - function check (key) { - chrome.storage.sync.get(key, function (resp) { - console.log('comparing to cloud', key, resp) - - function confirmDialog (callback) { - modalDialogCustom.confirm('', 'Overwrite "' + key + '"? Click Ok to overwrite local file with file from cloud. Cancel will push your local file to the cloud.', () => { callback(true) }, () => { callback(false) }) - } - - if (typeof resp[key] !== 'undefined' && obj[key] !== resp[key]) { - confirmDialog((result) => { - if (result) { - console.log('Overwriting', key) - filesProviders['browser'].set(key, resp[key]) - } - }) - } else { - console.log('add to obj', obj, key) - filesProviders['browser'].get(key, (error, content) => { - if (error) { - console.log(error) - } else { - obj[key] = content - } - }) - } - - done++ - if (done >= count) { - chrome.storage.sync.set(obj, function () { - console.log('updated cloud files with: ', obj, this, arguments) - }) - } - }) - } - - filesProviders['browser'].resolve('browser', (error, files) => { - if (!error) { - Object.keys(files).forEach((path) => { - filesProviders['browser'].get(path, (error, content) => { - if (error) { - console.log(error) - } else { - obj[path] = content - count++ - check(path) - } - }) - }) - } - }) -}