|
@@ -1,3 +1,7 @@
|
|
|
+// Sandstorm context is detected using the METEOR_SETTINGS environment variable
|
|
|
+// in the package definition.
|
|
|
+const isSandstorm = Meteor.settings && Meteor.settings.public &&
|
|
|
+ Meteor.settings.public.sandstorm;
|
|
|
Users = Meteor.users;
|
|
|
|
|
|
Users.attachSchema(new SimpleSchema({
|
|
@@ -394,24 +398,26 @@ if (Meteor.isServer) {
|
|
|
return fakeUserId.get() || getUserId();
|
|
|
};
|
|
|
|
|
|
- Users.after.insert((userId, doc) => {
|
|
|
- const fakeUser = {
|
|
|
- extendAutoValueContext: {
|
|
|
- userId: doc._id,
|
|
|
- },
|
|
|
- };
|
|
|
-
|
|
|
- fakeUserId.withValue(doc._id, () => {
|
|
|
- // Insert the Welcome Board
|
|
|
- Boards.insert({
|
|
|
- title: TAPi18n.__('welcome-board'),
|
|
|
- permission: 'private',
|
|
|
- }, fakeUser, (err, boardId) => {
|
|
|
-
|
|
|
- ['welcome-list1', 'welcome-list2'].forEach((title) => {
|
|
|
- Lists.insert({ title: TAPi18n.__(title), boardId }, fakeUser);
|
|
|
+ if (!isSandstorm) {
|
|
|
+ Users.after.insert((userId, doc) => {
|
|
|
+ const fakeUser = {
|
|
|
+ extendAutoValueContext: {
|
|
|
+ userId: doc._id,
|
|
|
+ },
|
|
|
+ };
|
|
|
+
|
|
|
+ fakeUserId.withValue(doc._id, () => {
|
|
|
+ // Insert the Welcome Board
|
|
|
+ Boards.insert({
|
|
|
+ title: TAPi18n.__('welcome-board'),
|
|
|
+ permission: 'private',
|
|
|
+ }, fakeUser, (err, boardId) => {
|
|
|
+
|
|
|
+ ['welcome-list1', 'welcome-list2'].forEach((title) => {
|
|
|
+ Lists.insert({ title: TAPi18n.__(title), boardId }, fakeUser);
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|