feat: disable firebase temp
This commit is contained in:
parent
5023788030
commit
2087b2d567
|
@ -22,10 +22,10 @@ import Routes from '../common/routes';
|
||||||
import RootComponent from "../common/pages/Root";
|
import RootComponent from "../common/pages/Root";
|
||||||
import { LocaleProvider } from 'antd';
|
import { LocaleProvider } from 'antd';
|
||||||
import enUS from 'antd/lib/locale-provider/en_US';
|
import enUS from 'antd/lib/locale-provider/en_US';
|
||||||
import {getMobileOperatingSystem} from "../common/stores/firebase";
|
// import {getMobileOperatingSystem} from "../common/stores/firebase";
|
||||||
import cinnamonSugar from "cinnamon-sugar";
|
import cinnamonSugar from "cinnamon-sugar";
|
||||||
import ButterToast from "butter-toast";
|
import ButterToast from "butter-toast";
|
||||||
import * as firebase from "firebase";
|
// import * as firebase from "firebase";
|
||||||
|
|
||||||
// var injectTapEventPlugin = require("react-tap-event-plugin");
|
// var injectTapEventPlugin = require("react-tap-event-plugin");
|
||||||
// injectTapEventPlugin();
|
// injectTapEventPlugin();
|
||||||
|
@ -40,31 +40,31 @@ const appstate = new AppState(Object.assign({
|
||||||
|
|
||||||
|
|
||||||
// if (getMobileOperatingSystem() !== 'iOS') {
|
// if (getMobileOperatingSystem() !== 'iOS') {
|
||||||
firebase.messaging().onMessage((payload) => {
|
// firebase.messaging().onMessage((payload) => {
|
||||||
console.log("Message received cok.", payload);
|
// console.log("Message received cok.", payload);
|
||||||
// alert(payload.notification.body);
|
// // alert(payload.notification.body);
|
||||||
|
//
|
||||||
if(payload.data.new_message){
|
// if(payload.data.new_message){
|
||||||
appstate.message.pushNewMessage(payload.data);
|
// appstate.message.pushNewMessage(payload.data);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if(payload.data.notification_type == 'notification'){
|
// if(payload.data.notification_type == 'notification'){
|
||||||
appstate.notification.unread_notif+=1
|
// appstate.notification.unread_notif+=1
|
||||||
}
|
// }
|
||||||
const toast = cinnamonSugar({
|
// const toast = cinnamonSugar({
|
||||||
kind: 'crisp',
|
// kind: 'crisp',
|
||||||
theme: 'info',
|
// theme: 'info',
|
||||||
// picture: 'http://lorempixel.com/150/150/people',
|
// // picture: 'http://lorempixel.com/150/150/people',
|
||||||
title: <a href={'inbox/'}>{payload.notification.title}</a>, // you can also add jsx code here!
|
// title: <a href={'inbox/'}>{payload.notification.title}</a>, // you can also add jsx code here!
|
||||||
// message: JSON.stringify(payload), // you can also add jsx code here!
|
// // message: JSON.stringify(payload), // you can also add jsx code here!
|
||||||
message: payload.notification.body, // you can also add jsx code here!
|
// message: payload.notification.body, // you can also add jsx code here!
|
||||||
toastTimeout: 4000,
|
// toastTimeout: 4000,
|
||||||
icon: 'bell' // literally any font awesome 4.7 icon
|
// icon: 'bell' // literally any font awesome 4.7 icon
|
||||||
// you may also add here regular butter-toast options, such as toastTimeout,
|
// // you may also add here regular butter-toast options, such as toastTimeout,
|
||||||
// name, sticky, etc..
|
// // name, sticky, etc..
|
||||||
});
|
// });
|
||||||
ButterToast.raise(toast)
|
// ButterToast.raise(toast)
|
||||||
});
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
render(
|
render(
|
||||||
|
|
|
@ -46,7 +46,7 @@ import cinnamonSugar from 'cinnamon-sugar';
|
||||||
import ButterToast from 'butter-toast';
|
import ButterToast from 'butter-toast';
|
||||||
import 'material-design-icons/iconfont/material-icons.css';
|
import 'material-design-icons/iconfont/material-icons.css';
|
||||||
import { grey400, darkBlack, lightBlack } from 'material-ui/styles/colors';
|
import { grey400, darkBlack, lightBlack } from 'material-ui/styles/colors';
|
||||||
import { getMobileOperatingSystem } from '../../stores/firebase';
|
// import { getMobileOperatingSystem } from '../../stores/firebase';
|
||||||
import Alert from "../../components/Alert";
|
import Alert from "../../components/Alert";
|
||||||
import EmptyComponent from '../EmptyComponent';
|
import EmptyComponent from '../EmptyComponent';
|
||||||
import NumberFormat from 'react-number-format';
|
import NumberFormat from 'react-number-format';
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {inject, observer} from 'mobx-react';
|
||||||
|
|
||||||
import './style.scss'
|
import './style.scss'
|
||||||
import {LINKS} from "../../routes";
|
import {LINKS} from "../../routes";
|
||||||
import {getMobileOperatingSystem} from '../../stores/firebase';
|
// import {getMobileOperatingSystem} from '../../stores/firebase';
|
||||||
import {Helmet} from "react-helmet";
|
import {Helmet} from "react-helmet";
|
||||||
import LoadingDialog from '../LoadingDialog/index';
|
import LoadingDialog from '../LoadingDialog/index';
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import DepositStore from "./deposit";
|
||||||
import WithdrawStore from "./withdraw";
|
import WithdrawStore from "./withdraw";
|
||||||
import Task from './task';
|
import Task from './task';
|
||||||
import Transaction from './transaction';
|
import Transaction from './transaction';
|
||||||
import {Firebase} from './firebase';
|
// import {Firebase} from './firebase';
|
||||||
import AirlinesDomestic from "./airlines_domestic";
|
import AirlinesDomestic from "./airlines_domestic";
|
||||||
import Airports from "./airports";
|
import Airports from "./airports";
|
||||||
import Categories from './categories';
|
import Categories from './categories';
|
||||||
|
@ -102,7 +102,7 @@ export default class AppState {
|
||||||
task = new Task(this);
|
task = new Task(this);
|
||||||
transaction = new Transaction(this);
|
transaction = new Transaction(this);
|
||||||
setting = new Setting(this);
|
setting = new Setting(this);
|
||||||
firebase = new Firebase(this);
|
// firebase = new Firebase(this);
|
||||||
userBanks = new UserBanks(this);
|
userBanks = new UserBanks(this);
|
||||||
stores = new Stores(this);
|
stores = new Stores(this);
|
||||||
storeList = new StoreList(this);
|
storeList = new StoreList(this);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* Created by 322 on 01/04/2017.
|
* Created by 322 on 01/04/2017.
|
||||||
*/
|
*/
|
||||||
import * as firebase from "firebase";
|
// import * as firebase from "firebase";
|
||||||
import {observable, action, computed} from 'mobx';
|
import {observable, action, computed} from 'mobx';
|
||||||
|
|
||||||
export function getMobileOperatingSystem() {
|
export function getMobileOperatingSystem() {
|
||||||
|
@ -44,8 +44,8 @@ export class Firebase {
|
||||||
storageBucket: "cerdas-fc4a2.appspot.com",
|
storageBucket: "cerdas-fc4a2.appspot.com",
|
||||||
messagingSenderId: "192592024837"
|
messagingSenderId: "192592024837"
|
||||||
};
|
};
|
||||||
firebase.initializeApp(config);
|
// firebase.initializeApp(config);
|
||||||
const messaging = firebase.messaging();
|
// const messaging = firebase.messaging();
|
||||||
messaging.requestPermission()
|
messaging.requestPermission()
|
||||||
.then(function() {
|
.then(function() {
|
||||||
console.log('Notification permission granted.');
|
console.log('Notification permission granted.');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user