From 89d622b8b2c755a35b35dbed6b40a13d76e250bd Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 9 Dec 2019 11:57:43 +0000 Subject: [PATCH] Remove the code that calls the origin migrator This will have done its job now, everyone's had long enough to install a newer version of Riot and migrate to the new origin. Laves the code on the backend that handles it for the time being, as per comment. --- electron_app/src/electron-main.js | 4 ++++ src/vector/index.js | 8 -------- src/vector/platform/ElectronPlatform.js | 4 ---- src/vector/platform/VectorBasePlatform.js | 8 -------- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index eaedf6b3f1..aa92bb3095 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -232,6 +232,10 @@ ipcMain.on('ipcCall', async function(ev, payload) { } break; case 'origin_migrate': + // NB. The code to call this has now been removed so this + // should never be called. This code itself has been removed + // with the migration to the riot-desktop repo, with the + // expectation that this will become the new home for this code. migratingOrigin = true; await migrateFromOldOrigin(); migratingOrigin = false; diff --git a/src/vector/index.js b/src/vector/index.js index c0cf2b4656..12c0cfe86d 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -191,14 +191,6 @@ async function loadApp() { console.log("Using Electron platform"); const plaf = new ElectronPlatform(); PlatformPeg.set(plaf); - - // Electron only: see if we need to do a one-time data - // migration - if (window.localStorage.getItem('mx_user_id') === null) { - console.log("Migrating session from old origin..."); - await plaf.migrateFromOldOrigin(); - console.log("Origin migration complete"); - } } else { console.log("Using Web platform"); PlatformPeg.set(new WebPlatform()); diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index eb5b2a86a5..1128c33fef 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -355,10 +355,6 @@ export default class ElectronPlatform extends VectorBasePlatform { window.location.reload(false); } - async migrateFromOldOrigin() { - return this._ipcCall('origin_migrate'); - } - async _ipcCall(name, ...args) { const ipcCallId = ++this._nextIpcCallId; return new Promise((resolve, reject) => { diff --git a/src/vector/platform/VectorBasePlatform.js b/src/vector/platform/VectorBasePlatform.js index 32b4382060..376b0a0e4f 100644 --- a/src/vector/platform/VectorBasePlatform.js +++ b/src/vector/platform/VectorBasePlatform.js @@ -173,12 +173,4 @@ export default class VectorBasePlatform extends BasePlatform { getDefaultDeviceDisplayName(): string { return _t("Unknown device"); } - - /** - * Migrate account data from a previous origin - * Used only for the electron app - */ - async migrateFromOldOrigin() { - return false; - } }