Fix pads not stored in the correct folder the first time

pull/1/head
yflory 7 years ago
parent 9f9664eba1
commit c802b761c7

@ -460,7 +460,7 @@ define([
if (typeof(meta) === "object") { if (typeof(meta) === "object") {
meta.defaultTitle = meta.title || meta.defaultTitle; meta.defaultTitle = meta.title || meta.defaultTitle;
delete meta.users; delete meta.users;
delete meta.title; meta.title = "";
} }
val = JSON.stringify(parsed); val = JSON.stringify(parsed);
} catch (e) { } catch (e) {
@ -489,6 +489,13 @@ define([
if (typeof (data.title) !== "string") { return cb('Missing title'); } if (typeof (data.title) !== "string") { return cb('Missing title'); }
if (data.title.trim() === "") { data.title = Hash.getDefaultName(parsed); } 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) { postMessage("SET_PAD_TITLE", data, function (obj) {
if (obj && obj.error) { if (obj && obj.error) {
console.log("unable to set pad title"); console.log("unable to set pad title");
@ -837,7 +844,7 @@ define([
driveEvents: rdyCfg.driveEvents driveEvents: rdyCfg.driveEvents
}; };
if (sessionStorage[Constants.newPadPathKey]) { if (sessionStorage[Constants.newPadPathKey]) {
cfg.initialPath = sessionStorage[Constants.newPadPathKey]; common.initialPath = sessionStorage[Constants.newPadPathKey];
delete sessionStorage[Constants.newPadPathKey]; delete sessionStorage[Constants.newPadPathKey];
} }
AStore.query("CONNECT", cfg, waitFor(function (data) { AStore.query("CONNECT", cfg, waitFor(function (data) {

Loading…
Cancel
Save