meteor-react

Android: URL.createObjectURL does not work properly (Failed to load because no supported source was found.)

╄→尐↘猪︶ㄣ 提交于 2019-12-11 01:13:09
问题 I am trying to play an audio file that has been stored in LocalForage of my Meteor Android App. LocalForage.getItem(track_id, (err, value)=>{ if(err) throw err; //the loaded value is an arraybuffer of an m4a file let blob = new Blob([value]); let url = (window.URL || window.webkitURL || window || {}).createObjectURL(blob); let testAudio = new Audio(url); testAudio.play().then(()=>{console.log("play successful")}).catch((err)=>{console.error(err)}); }); Before, I passed the url to an Instance

Required Package in combination meteor+react+react-bootstrap

ぐ巨炮叔叔 提交于 2019-12-10 12:10:40
问题 I used the following packages individually and combined $ meteor add react $ meteor add firfi:meteor-react-bootstrap When I used the react package, bootstrap is not working. If I use firfi:meteor-react-bootstrap , the react package is not working. When I used both packages there is an error Uncaught Error : Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was

How to apply Tracker.autorun? Meteor.userId() undefined right after refreshing page

会有一股神秘感。 提交于 2019-12-08 07:04:43
问题 I have a restricted page using Meteor.userId() and roles: class AdminPage extends Component { render() { return ( <div> { Roles.userIsInRole(Meteor.userId(), 'admin') ? ( <Master_Layout renderCenter={<Article_Editor />}/> ) : browserHistory.push('/') } </div> ) } } This code redirects user to "/" after refresh because Meteor.userId() is undefined. How do I make sure Meteor.userId() is not undefined before rendering the page after refresh? I searched for answers. I found Tracker.autorun as a

How to apply Tracker.autorun? Meteor.userId() undefined right after refreshing page

我怕爱的太早我们不能终老 提交于 2019-12-06 16:41:40
I have a restricted page using Meteor.userId() and roles: class AdminPage extends Component { render() { return ( <div> { Roles.userIsInRole(Meteor.userId(), 'admin') ? ( <Master_Layout renderCenter={<Article_Editor />}/> ) : browserHistory.push('/') } </div> ) } } This code redirects user to "/" after refresh because Meteor.userId() is undefined. How do I make sure Meteor.userId() is not undefined before rendering the page after refresh? I searched for answers. I found Tracker.autorun as a solution, but I did not understand how to apply it. Thank you for help. I updated the code: constructor

Meteor/React - How to wait for Meteor.user()

时光毁灭记忆、已成空白 提交于 2019-12-04 03:25:37
I'm struggling to figure out how to wait for the Meteor.user() subscription in a react component. I know the user is logged in because Meteor.userId() returns the _id , but trying to access the email address show Meteor.user() returns undefined. I assume because it's not available just yet. Alas, since Meteor.user() isn't a publication I manually subscribe to, I'm not sure how to wait for it in a React component. Can someone point me towards an example? import { Meteor } from 'meteor/meteor'; import React from 'react'; import { Link } from 'react-router'; import { createContainer } from