Skip to content

Commit

Permalink
fix: some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Jun 19, 2019
1 parent 54b50f0 commit 821050c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
2 changes: 2 additions & 0 deletions packages/client/assets/style/host.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
display: grid;
padding: 0 20px;
height: 100vh;
min-width: 720px;
grid-template-rows: 1fr 50px;
grid-template-columns: 1fr 480px;
grid-template-areas:
Expand All @@ -21,6 +22,7 @@
grid-area: left;
margin: 20px 0;
color: var(--color-white);
width: calc(100vw - 480px - 20px * 2);

& > .host-note {
& pre {
Expand Down
5 changes: 3 additions & 2 deletions packages/client/src/components/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class AppContainer extends React.Component {

this.params = parsedUrl.searchParams;
this.ContentComponent = null;
this.isLive = this.params.get('isLive');

this.routeMode();
}
Expand Down Expand Up @@ -118,8 +119,8 @@ export class AppContainer extends React.Component {
}

if (this.mode === 'host') {
this.setState({ opened: false });
} else if (process.env.IS_LIVE) {
this.setState({ opened: false, CommentsListComponent: null });
} else if (process.env.IS_LIVE && this.isLive !== 'false') {
this.setupLive();
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/client/src/components/CommentsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export class CommentsList extends React.Component {
this.ws.onmessage = ({ data }) => {
const comments = JSON.parse(data);

console.log(comments);

if (Array.isArray(comments) && comments.length !== 0) {
if (comments[0].message === 'Rate limit exceeded') {
// TODO: implement
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/ContentView/Host.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class Host extends React.PureComponent {
const { origin, pathname } = new URL(window.location);

this.slides = props.slides; // TODO: separate from current reference
this.slideUrl = `${origin}/${pathname}?sidebar=false#slide=`;
this.slideUrl = `${origin}/${pathname}?sidebar=false&isLive=false#slide=`;
this.presentationController = new PresentationController();
this.presentationApiId = null;

Expand Down
18 changes: 4 additions & 14 deletions packages/fusuma/src/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ async function pdfProcess(basePath, { input: i, output: o }) {
const spinner = loader('Exporting as PDF...').start();

try {
const pack = '@fusuma/task-pdf';
// for debug
// const pack = join(__dirname, '../../task-pdf');

const pack = process.env.FUSUMA_DEBUG ? join(__dirname, '../../task-pdf') : '@fusuma/task-pdf';
const pdf = await lazyloadModule(pack, (type) => {
if (type === 'fallback') {
spinner.color = 'yellow';
Expand All @@ -93,12 +90,6 @@ async function pdfProcess(basePath, { input: i, output: o }) {
}

async function live(basePath, { keyword, internal, port, dir }) {
if (!keyword) {
console.warn(
'Twitter mode is disabled. If you want to enable, you must specify an searched keyword'
);
}

await buildProcess(basePath, {
server: {
port,
Expand All @@ -110,10 +101,9 @@ async function live(basePath, { keyword, internal, port, dir }) {
const spinner = loader('Setup live mode...').start();

try {
const pack = '@fusuma/task-live';
// for debug
// const pack = join(__dirname, '../../task-live');

const pack = process.env.FUSUMA_DEBUG
? join(__dirname, '../../task-live')
: '@fusuma/task-live';
const liveServer = await lazyloadModule(pack, (type) => {
if (type === 'fallback') {
spinner.color = 'yellow';
Expand Down
4 changes: 4 additions & 0 deletions packages/task-live/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function setupServer({ port = 3000, keyword, interval = 6000, dir = 'dist' }) {

console.info('Twitter mode is enabled.');
}
} else {
console.warn(
'Twitter mode is disabled. If you want to enable, you must specify an searched keyword'
);
}

const app = express();
Expand Down
6 changes: 3 additions & 3 deletions samples/intro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"scripts": {
"start": "node ../../packages/fusuma/src/cli.js start",
"build": "node ../../packages/fusuma/src/cli.js build",
"pdf": "node ../../packages/fusuma/src/cli.js pdf",
"live": "node ../../packages/fusuma/src/cli.js live -w '#javascript'",
"live:local": "node ../../packages/fusuma/src/cli.js live"
"pdf": "FUSUMA_DEBUG=true node ../../packages/fusuma/src/cli.js pdf",
"live": "FUSUMA_DEBUG=true node ../../packages/fusuma/src/cli.js live -w '#javascript'",
"live:local": "FUSUMA_DEBUG=true node ../../packages/fusuma/src/cli.js live"
},
"author": "hiroppy <[email protected]> (https://hiroppy.me)",
"license": "MIT",
Expand Down

0 comments on commit 821050c

Please sign in to comment.