* Javadoc introduced @code as a replacement of <code> and <tt> which is better aligned with other javadoc tags such as @link. Use it in the Java source code. If we switch to Kotlin, then we'll definitely use Markdown. * There are more uses of @code in the JavaScript source code than <tt> so use @code for the sake of consistency. Eventually, I'd rather we switch to Markdown because it's easier on my eyes. * Xcode is plain confused by @code and @link. The Internet says that Xcode supports the backquote character to denote the beginning and end of a string of characters which should be formatted for display as code but it doesn't work for me. <tt> is not rendered at all. So use the backquote which is rendered itself. Hopefully, if we switch to Markdown, then it'll be common between JavaScript and Objective-C source code.
36 lines
830 B
JavaScript
36 lines
830 B
JavaScript
/* @flow */
|
|
|
|
import { RouteRegistry } from '../base/react';
|
|
|
|
import { WelcomePage } from './components';
|
|
import {
|
|
generateRoomWithoutSeparator,
|
|
isWelcomePageAppEnabled,
|
|
isWelcomePageUserEnabled
|
|
} from './functions';
|
|
|
|
/**
|
|
* Register route for {@code WelcomePage}.
|
|
*/
|
|
RouteRegistry.register({
|
|
component: WelcomePage,
|
|
onEnter,
|
|
path: '/'
|
|
});
|
|
|
|
/**
|
|
* Skips the {@code WelcomePage} if it is disabled (by the app or the user).
|
|
*
|
|
* @param {Object} store - The redux store.
|
|
* @param {Function} replace - The function to redirect to another path.
|
|
* @returns {void}
|
|
*/
|
|
function onEnter({ getState }, replace) {
|
|
if (isWelcomePageAppEnabled(getState)) {
|
|
isWelcomePageUserEnabled(getState)
|
|
|| replace(`/${generateRoomWithoutSeparator()}`);
|
|
} else {
|
|
replace(undefined);
|
|
}
|
|
}
|