diff --git a/src/appstore.js b/src/appstore.js index 618a78c83..960ac465c 100644 --- a/src/appstore.js +++ b/src/appstore.js @@ -283,7 +283,7 @@ async function registerCloudron(data) { if (!response.body.cloudronId) throw new BoxError(BoxError.EXTERNAL_ERROR, 'Invalid response - no cloudron id'); if (!response.body.cloudronToken) throw new BoxError(BoxError.EXTERNAL_ERROR, 'Invalid response - no token'); - await settings.setCloudronId(response.body.cloudronId); + await settings.set(settings.CLOUDRON_ID_KEY, response.body.cloudronId); await settings.set(settings.APPSTORE_API_TOKEN_KEY, response.body.cloudronToken); await settings.set(settings.APPSTORE_WEB_TOKEN_KEY, accessToken); @@ -329,7 +329,7 @@ async function registerWithLoginCredentials(options) { } async function unregister() { - await settings.setCloudronId(''); + await settings.set(settings.CLOUDRON_ID_KEY, ''); await settings.set(settings.APPSTORE_API_TOKEN_KEY, ''); await settings.set(settings.APPSTORE_WEB_TOKEN_KEY, ''); } diff --git a/src/settings.js b/src/settings.js index 151436631..a58356b3f 100644 --- a/src/settings.js +++ b/src/settings.js @@ -34,9 +34,6 @@ exports = module.exports = { getLanguage, setLanguage, - getCloudronId, - setCloudronId, - getSysinfoConfig, setSysinfoConfig, @@ -157,7 +154,6 @@ const gDefaults = (function () { provider: 'noop' }; result[exports.LANGUAGE_KEY] = 'en'; - result[exports.CLOUDRON_ID_KEY] = ''; result[exports.BACKUP_CONFIG_KEY] = { provider: 'filesystem', backupFolder: paths.DEFAULT_BACKUP_DIR, @@ -563,19 +559,6 @@ async function setLanguage(language) { notifyChange(exports.LANGUAGE_KEY, language); } -async function getCloudronId() { - const value = await get(exports.CLOUDRON_ID_KEY); - if (value === null) return gDefaults[exports.CLOUDRON_ID_KEY]; - return value; -} - -async function setCloudronId(cid) { - assert.strictEqual(typeof cid, 'string'); - - await set(exports.CLOUDRON_ID_KEY, cid); - notifyChange(exports.CLOUDRON_ID_KEY, cid); -} - async function list() { const settings = await database.query(`SELECT ${SETTINGS_FIELDS} FROM settings WHERE value IS NOT NULL ORDER BY name`);