meteor

Meteor WebSocket is already in CLOSING or CLOSED state error

不打扰是莪最后的温柔 提交于 2020-01-07 05:32:09
问题 After implementing Detecting idle time in JavaScript elegantly I get "WebSocket is already in CLOSING or CLOSED state" error in the browser console. How to fix this issue? Here is my code: var inactivityTime = function () { var t; window.onload = resetTimer; document.onmousemove = resetTimer; document.onkeypress = resetTimer; function detector() { alert("You are idle!"); } function resetTimer() { console.log("RESET!"); clearTimeout(t); t = setTimeout(detector, 10000) // 1000 milisec = 1 sec }

Meteor : Run command on Heroku app

痴心易碎 提交于 2020-01-07 04:23:07
问题 I do have Meteor installed on my Heroku app. Due to some vulnerabilities concern Heroku is asking me to update Node.js version which is possible by updating the Meteor version as directed here But how would I run the update on my heroku. Currently I'm using command: heroku run meteor update --release 1.5.1 -a myappname 回答1: I think you need to go to your Meteor project (repo) with your code editor, do the update, make sure everything runs ok on "local". A good opportunity to run "npm outdated

Access to a collection from resolve

。_饼干妹妹 提交于 2020-01-07 03:45:09
问题 How can I verify a specific field from the users collection of the accounts module of meteor ? Supposing the next code: $stateProvider.state('myState', { resolve:{ function($q) { if(Meteor.userId()){ return $q.resolve(); } else { retrun $q.reject(); } } } }) Inside the resolve is possible to use the Meteor.userId() function to retrieve the _id from the user, but I cant use the Meteor.user() function in the same way. How can I retrieve custom data from that collection from the resolve 回答1:

Preventing access to a page in Meteor

故事扮演 提交于 2020-01-07 03:25:28
问题 I am building an app in meteor in which one of the pages is visible to user only if the user is logged in. The link to the page is in the navigation header and I want a login dialog to be displayed when the user clicks on the link without logging in. Here is the code for showing the dialog : <template name="header"> <a href="#" id="createPost">Create Post</a> </template> Template.header.events({ "click #createPost": function (evt) { evt.preventDefault(); if(!Meteor.user()) { $('#myModal')

DataURI to Blob errors: DOM Exception 5: An invalid or illegal character was specified

妖精的绣舞 提交于 2020-01-07 02:52:10
问题 I'm using Meteor with a Cordova plugin to record a video on an iPhone, then convert that to a blob for uploading. About half of the time I try to convert the video from the local filesystem to a blob it works and the other half it gives this error: InvalidCharacterError: DOM Exception 5: An invalid or illegal character was specified, such as in an XML name. It seems like it usually happens when the video is longer than 3 seconds, but it has happened on the really short videos. Here is my

Display only users with a specific role in meteor-tabular table

二次信任 提交于 2020-01-07 02:39:52
问题 My site allows users to apply by connecting their google account, as soon as an account is created they're given a "pending" role (using alanning:roles package). I would like to have a table for admins to see when new applicants have applied, from there the admin can properly manage the users application (change role to accepted, declined, etc.). So, I have created my table, but it's showing all users, I'm wondering if someone knows a way to make it so only users with the "pending" role are

Publish only things who were read 10seconds ago from now

十年热恋 提交于 2020-01-07 02:36:19
问题 I need to publish the stats from my CPU, Memory and other things that are stored in a collection. The things is it need to publish only the 10 last seconds from now. I join a picture to help the understanding of this: And I coded a function but the problem is that it doesn't remove the infos that are 11sec,12sec... older than now. Meteor.publish('dockerStats', function readInfosDockerStats(timeLimitSecond) { console.log(moment(new Date()).subtract(timeLimitSecond, 'second').toDate()) return

Meteor - Make Datatables Reactive

醉酒当歌 提交于 2020-01-07 01:18:07
问题 I'm having a problem with my Meteor app. Apparently, the datatable does not update properly. When I save a new data, it automatically adds a new row, but the table is not updating correctly (e.g. it says 'Showing 1 to 6 of 6 entries' when in fact it has 7 entries already.) I also tried destroying the table then re-initializing it again, but no luck. I've read the autorun function, but I'm not sure how to implement it. Is there a way to manually refresh/re-render the template via JS? So that I

NPM ERR! When trying to run Meteor project

人盡茶涼 提交于 2020-01-06 20:15:20
问题 I'm trying to view someone else's Meteor project from Github. I cloned it then tried running it by typing 'meteor' but what results is this slew of errors. I've included a sample below. I am running the command prompt as administrator. Clearly this has something to do with Node or its packages but I'm at a loss of where I should go with this. If someone could give me a hint I would be grateful. npm http GET https://registry.npmjs.org/camelcase npm http GET https://registry.npmjs.org/map-obj

Meteor passing an id into a link

£可爱£侵袭症+ 提交于 2020-01-06 19:53:21
问题 now my database is working i want the user to click on one of the things in the database to get a more detailed view but the id of the data is not inserted in the link <template name="meineEvents"> <ul> {{#each event}} <li>{{name}}</li> {{/each}} <a href="/eventDetails/{{_id}}">mehr Details</a> </ul> </template> but when i click on the link i only see the http://localhost:3000/eventDetails/ without the id behind the eventDetails/ im running Meteor 1.4 with Blaze Thank you for your help ;) 回答1