tutorial: launch from omnibox

This commit is contained in:
Liam Fitzgerald 2021-02-11 10:42:11 +10:00
parent 4c4667c0d9
commit 7568ecc2b4
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
2 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,7 @@ const commandIndex = function (currentGroup) {
commands.push(result(`Groups: Create`, `/~landscape/new`, 'Groups', null)); commands.push(result(`Groups: Create`, `/~landscape/new`, 'Groups', null));
commands.push(result(`Groups: Join`, `/~landscape/join`, 'Groups', null)); commands.push(result(`Groups: Join`, `/~landscape/join`, 'Groups', null));
commands.push(result(`Channel: Create`, `/~landscape${workspace}/new`, 'Groups', null)); commands.push(result(`Channel: Create`, `/~landscape${workspace}/new`, 'Groups', null));
commands.push(result(`Tutorial`, '/?tutorial=true', 'Null', null));
return commands; return commands;
}; };

View File

@ -20,6 +20,7 @@ import { JoinGroup } from "~/views/landscape/components/JoinGroup";
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import useLocalState from "~/logic/state/local"; import useLocalState from "~/logic/state/local";
import { useWaitForProps } from '~/logic/lib/useWaitForProps'; import { useWaitForProps } from '~/logic/lib/useWaitForProps';
import { useQuery } from "~/logic/lib/useQuery";
import { import {
hasTutorialGroup, hasTutorialGroup,
TUTORIAL_GROUP, TUTORIAL_GROUP,
@ -69,6 +70,15 @@ export default function LaunchApp(props) {
</Box> </Box>
); );
const { query } = useQuery();
useEffect(() => {
if(query.tutorial) {
props.api.settings.putEntry('tutorial', 'seen', false);
}
}, [query]);
const { tutorialProgress, nextTutStep } = useLocalState(tutSelector); const { tutorialProgress, nextTutStep } = useLocalState(tutSelector);
const waiter = useWaitForProps(props); const waiter = useWaitForProps(props);