Skip to content

Commit

Permalink
Wrap featureTips markdown
Browse files Browse the repository at this point in the history
`markdown` takes too long to load for it to be worth preloading
  • Loading branch information
larsjohnsen committed Sep 13, 2018
1 parent ef5a04d commit 24e1e34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/modules/RESTips.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ async function dailyTip(): Promise<boolean> { // `true` if daily tip is being sh
function generateContent({ message, keyboard, options }: Tip) {
const description = [];

if (message) description.push(message);
if (typeof message === 'function') description.push(message());
else if (typeof message === 'string') description.push(message);

if (keyboard) {
// TODO: microtemplate
Expand Down Expand Up @@ -204,7 +205,7 @@ function generateContentOption(option) {
}

export type Tip = {|
message: string,
message: string | () => string,
title?: string,
attachTo?: string | HTMLElement,
position?: number,
Expand Down
3 changes: 2 additions & 1 deletion lib/modules/filteReddit.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ RES allows you to easily apply complex filters to post listings and comments. To
quiet: true,
},
filterlineVisible: {
message: markdown(`
// Wrap as to avoid loading markdown unnecessarily
message: () => markdown(`
* Click once on a filter to enable it (e.g. clicking \`expando\` will only show posts with embedded media).
* Click again to only show posts which do not not match.
* A third click makes the filter inactive.
Expand Down

0 comments on commit 24e1e34

Please sign in to comment.