This commit is contained in:
syuilo 2017-11-16 03:06:52 +09:00
parent a2f75ea49d
commit 8b91502ab5
21 changed files with 267 additions and 165 deletions

View file

@ -4,9 +4,10 @@
import * as riot from 'riot';
import * as route from 'page';
import MiOS from '../common/mios';
let page = null;
export default me => {
export default (mios: MiOS) => {
route('/', index);
route('/selectdrive', selectDrive);
route('/i/customize-home', customizeHome);
@ -22,7 +23,7 @@ export default me => {
route('*', notFound);
function index() {
me ? home() : entrance();
mios.isSignedin ? home() : entrance();
}
function home() {

View file

@ -12,11 +12,12 @@ import init from '../init';
import route from './router';
import fuckAdBlock from './scripts/fuck-ad-block';
import getPostSummary from '../../../common/get-post-summary';
import MiOS from '../common/mios';
/**
* init
*/
init(async (me, stream) => {
init(async (mios: MiOS) => {
/**
* Fuck AD Block
*/
@ -32,12 +33,12 @@ init(async (me, stream) => {
}
if ((Notification as any).permission == 'granted') {
registerNotifications(stream);
registerNotifications(mios.stream);
}
}
// Start routing
route(me);
route(mios);
});
function registerNotifications(stream) {

View file

@ -62,6 +62,8 @@
</style>
<script>
this.mixin('os');
this.data = {
view: 0,
design: 0
@ -76,7 +78,7 @@
this.initializing = true;
this.on('mount', () => {
this.api('meta').then(meta => {
this.mios.getMeta().then(meta => {
this.update({
initializing: false,
meta