feat: disable firebase temp

This commit is contained in:
Hasta Ragil Saputra 2019-01-31 13:44:38 +07:00
parent 5023788030
commit 2087b2d567
5 changed files with 45 additions and 45 deletions

View File

@ -22,10 +22,10 @@ import Routes from '../common/routes';
import RootComponent from "../common/pages/Root";
import { LocaleProvider } from 'antd';
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 ButterToast from "butter-toast";
import * as firebase from "firebase";
// import * as firebase from "firebase";
// var injectTapEventPlugin = require("react-tap-event-plugin");
// injectTapEventPlugin();
@ -40,31 +40,31 @@ const appstate = new AppState(Object.assign({
// if (getMobileOperatingSystem() !== 'iOS') {
firebase.messaging().onMessage((payload) => {
console.log("Message received cok.", payload);
// alert(payload.notification.body);
if(payload.data.new_message){
appstate.message.pushNewMessage(payload.data);
}
if(payload.data.notification_type == 'notification'){
appstate.notification.unread_notif+=1
}
const toast = cinnamonSugar({
kind: 'crisp',
theme: 'info',
// picture: 'http://lorempixel.com/150/150/people',
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: payload.notification.body, // you can also add jsx code here!
toastTimeout: 4000,
icon: 'bell' // literally any font awesome 4.7 icon
// you may also add here regular butter-toast options, such as toastTimeout,
// name, sticky, etc..
});
ButterToast.raise(toast)
});
// firebase.messaging().onMessage((payload) => {
// console.log("Message received cok.", payload);
// // alert(payload.notification.body);
//
// if(payload.data.new_message){
// appstate.message.pushNewMessage(payload.data);
// }
//
// if(payload.data.notification_type == 'notification'){
// appstate.notification.unread_notif+=1
// }
// const toast = cinnamonSugar({
// kind: 'crisp',
// theme: 'info',
// // picture: 'http://lorempixel.com/150/150/people',
// 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: payload.notification.body, // you can also add jsx code here!
// toastTimeout: 4000,
// icon: 'bell' // literally any font awesome 4.7 icon
// // you may also add here regular butter-toast options, such as toastTimeout,
// // name, sticky, etc..
// });
// ButterToast.raise(toast)
// });
// }
render(

View File

@ -46,7 +46,7 @@ import cinnamonSugar from 'cinnamon-sugar';
import ButterToast from 'butter-toast';
import 'material-design-icons/iconfont/material-icons.css';
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 EmptyComponent from '../EmptyComponent';
import NumberFormat from 'react-number-format';

View File

@ -4,7 +4,7 @@ import {inject, observer} from 'mobx-react';
import './style.scss'
import {LINKS} from "../../routes";
import {getMobileOperatingSystem} from '../../stores/firebase';
// import {getMobileOperatingSystem} from '../../stores/firebase';
import {Helmet} from "react-helmet";
import LoadingDialog from '../LoadingDialog/index';

View File

@ -23,7 +23,7 @@ import DepositStore from "./deposit";
import WithdrawStore from "./withdraw";
import Task from './task';
import Transaction from './transaction';
import {Firebase} from './firebase';
// import {Firebase} from './firebase';
import AirlinesDomestic from "./airlines_domestic";
import Airports from "./airports";
import Categories from './categories';
@ -102,7 +102,7 @@ export default class AppState {
task = new Task(this);
transaction = new Transaction(this);
setting = new Setting(this);
firebase = new Firebase(this);
// firebase = new Firebase(this);
userBanks = new UserBanks(this);
stores = new Stores(this);
storeList = new StoreList(this);

View File

@ -1,7 +1,7 @@
/**
* Created by 322 on 01/04/2017.
*/
import * as firebase from "firebase";
// import * as firebase from "firebase";
import {observable, action, computed} from 'mobx';
export function getMobileOperatingSystem() {
@ -44,8 +44,8 @@ export class Firebase {
storageBucket: "cerdas-fc4a2.appspot.com",
messagingSenderId: "192592024837"
};
firebase.initializeApp(config);
const messaging = firebase.messaging();
// firebase.initializeApp(config);
// const messaging = firebase.messaging();
messaging.requestPermission()
.then(function() {
console.log('Notification permission granted.');