diff --git a/index.js b/index.js index fa6a410..151824c 100644 --- a/index.js +++ b/index.js @@ -43,7 +43,6 @@ app.route('/*', require('./views/404')) if (typeof window !== 'undefined') { document.body.appendChild(app.start()) - app.mount('body') } -module.exports = app.mount('body') +module.exports = app diff --git a/stores/main.js b/stores/main.js index f80b63d..20678f1 100644 --- a/stores/main.js +++ b/stores/main.js @@ -159,7 +159,7 @@ state.main = { // }); - emitter.on('DOMContentLoaded', function () { +// emitter.on('DOMContentLoaded', function () { emitter.on('LISTS_FIND', listsApi.find) emitter.on('LISTS_FIND_MORE', listsApi.findMore); emitter.on('LISTS_GET', (query) => { @@ -218,7 +218,7 @@ state.main = { state.main.selected.user.links = result; emitter.emit('render'); }).catch(err => { - console.log(err); + console(err); return err; }) @@ -251,7 +251,7 @@ state.main = { }) - }) +// }) function setQueryUserid(userid){ @@ -290,60 +290,3 @@ state.main = { } - - -/** - -let findFollowers = { - query:{ - "followers": { - "$in": [] - } - } - } - - let findUserFollowers = { - query:{ - "following": { - "$in": [] - } - } - } - - findFollowers.query.followers.$in = [state.selectedUser.profile._id]; - return state.api.lists.find(findFollowers) - - - state.api.users.find(findByUsername) - .then(result => { - state.selectedUser.profile = result.data[0]; - queryParams.query.$or[0].owner = state.selectedUser.profile._id; - queryParams.query.$or[1].collaborators.$in = [state.selectedUser.profile._id]; - return state.api.links.find(queryParams) - }) - .then(result => { - state.selectedUser.links = result.data; - return state.api.lists.find(queryParams) - }) - .then(result => { - state.selectedUser.lists = result.data; - findFollowers.query.followers.$in = [state.selectedUser.profile._id]; - return state.api.lists.find(findFollowers) - }) - .then(result => { - state.selectedUser.listsFollowing = result.data; - findUserFollowers.query.following.$in = [state.selectedUser.profile._id]; - return state.api.users.find(findUserFollowers) - }) - .then(result => { - state.selectedUser.followers = result.data; - emitter.emit('render'); - }) - .catch(err =>{ - alert(err); - }) - - - - - */ \ No newline at end of file diff --git a/stores/user.js b/stores/user.js index 1fcd718..c694b47 100644 --- a/stores/user.js +++ b/stores/user.js @@ -168,7 +168,7 @@ function store(state, emitter) { state.events.USER_SENDVERIFICATIONTOKEN = 'USER_SENDVERIFICATIONTOKEN'; // Events - emitter.on("DOMContentLoaded", () => { + // emitter.on("DOMContentLoaded", () => { // when the DOM loads auth.checkLogin(); emitter.on(state.events.USER_SIGNUP, auth.signup) @@ -177,7 +177,7 @@ function store(state, emitter) { emitter.on(state.events.USER_RESETPASSWORD, auth.resetPassword) emitter.on(state.events.USER_SENDRESETPASSWORD, auth.sendResetPassword) emitter.on(state.events.USER_SENDVERIFICATIONTOKEN, auth.sendVerificationToken) - }) + // }) // Doers