Fix calendar view URL

pull/1/head
yflory 4 years ago
parent 5dded12f53
commit 67fae22156

@ -759,7 +759,7 @@ Messages.calendar_tempCalendar = "Temp calendar";
onEvent: onEvent
});
APP.module.execCommand('SUBSCRIBE', null, function (obj) {
if (obj.empty) {
if (obj.empty && !privateData.calendarHash) {
// No calendar yet, create one
newCalendar({
teamId: 1,
@ -777,7 +777,7 @@ Messages.calendar_tempCalendar = "Temp calendar";
hash: privateData.hashes.editHash || privateData.hashes.viewHash,
password: privateData.password
}, function (obj) {
console.error(obj); // XXX
if (obj && obj.error) { console.error(obj.error); }
});
}
makeCalendar();

@ -326,10 +326,12 @@ ctx.calendars[channel] = {
var openCalendar = function (ctx, data, cId, cb) {
var secret = Hash.getSecrets('calendar', data.hash, data.password);
var hash = Hash.getEditHashFromKeys(secret);
var roHash = Hash.getViewHashFromKeys(secret);
var cal = {
href: Hash.hashToHref(Hash.getEditHashFromKeys(secret), 'calendar'),
roHref: Hash.hashToHref(Hash.getViewHashFromKeys(secret), 'calendar'),
href: hash && Hash.hashToHref(hash, 'calendar'),
roHref: roHash && Hash.hashToHref(roHash, 'calendar'),
channel: secret.channel,
color: Util.getRandomColor(),
title: '...'

Loading…
Cancel
Save