From c802b761c78d285f6f1ef0f3e7a1b22719ba847e Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 19 Jun 2018 11:04:39 +0200 Subject: [PATCH] Fix pads not stored in the correct folder the first time --- www/common/cryptpad-common.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 001358651..5015ffa8f 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -460,7 +460,7 @@ define([ if (typeof(meta) === "object") { meta.defaultTitle = meta.title || meta.defaultTitle; delete meta.users; - delete meta.title; + meta.title = ""; } val = JSON.stringify(parsed); } catch (e) { @@ -489,6 +489,13 @@ define([ if (typeof (data.title) !== "string") { return cb('Missing title'); } if (data.title.trim() === "") { data.title = Hash.getDefaultName(parsed); } + if (common.initialPath) { + if (!data.path) { + data.path = common.initialPath; + delete common.initialPath; + } + } + postMessage("SET_PAD_TITLE", data, function (obj) { if (obj && obj.error) { console.log("unable to set pad title"); @@ -837,7 +844,7 @@ define([ driveEvents: rdyCfg.driveEvents }; if (sessionStorage[Constants.newPadPathKey]) { - cfg.initialPath = sessionStorage[Constants.newPadPathKey]; + common.initialPath = sessionStorage[Constants.newPadPathKey]; delete sessionStorage[Constants.newPadPathKey]; } AStore.query("CONNECT", cfg, waitFor(function (data) {