mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 08:34:25 +03:00
Merge pull request #4595 from urbit/lf/fix-tut
tutorial: update for zustand
This commit is contained in:
commit
d39ab24c8f
@ -32,6 +32,7 @@ import {
|
||||
} from '~/logic/lib/tutorialModal';
|
||||
import useLaunchState from '~/logic/state/launch';
|
||||
import useSettingsState, { selectCalmState } from '~/logic/state/settings';
|
||||
import useMetadataState from '~/logic/state/metadata';
|
||||
|
||||
|
||||
const ScrollbarLessBox = styled(Box)`
|
||||
@ -48,6 +49,7 @@ export default function LaunchApp(props) {
|
||||
const baseHash = useLaunchState(state => state.baseHash);
|
||||
const [hashText, setHashText] = useState(baseHash);
|
||||
const [exitingTut, setExitingTut] = useState(false);
|
||||
const associations = useMetadataState(s => s.associations);
|
||||
const hashBox = (
|
||||
<Box
|
||||
position={["relative", "absolute"]}
|
||||
@ -78,7 +80,7 @@ export default function LaunchApp(props) {
|
||||
|
||||
useEffect(() => {
|
||||
if(query.get('tutorial')) {
|
||||
if(hasTutorialGroup(props)) {
|
||||
if(hasTutorialGroup({ associations })) {
|
||||
nextTutStep();
|
||||
} else {
|
||||
showModal();
|
||||
@ -92,7 +94,7 @@ export default function LaunchApp(props) {
|
||||
let { hideGroups } = useLocalState(tutSelector);
|
||||
!hideGroups ? { hideGroups } = calmState : null;
|
||||
|
||||
const waiter = useWaitForProps(props);
|
||||
const waiter = useWaitForProps({ ...props, associations });
|
||||
|
||||
const { modal, showModal } = useModal({
|
||||
position: 'relative',
|
||||
@ -105,7 +107,7 @@ export default function LaunchApp(props) {
|
||||
};
|
||||
const onContinue = async (e) => {
|
||||
e.stopPropagation();
|
||||
if(!hasTutorialGroup(props)) {
|
||||
if(!hasTutorialGroup({ associations })) {
|
||||
await props.api.groups.join(TUTORIAL_HOST, TUTORIAL_GROUP);
|
||||
await props.api.settings.putEntry('tutorial', 'joined', Date.now());
|
||||
await waiter(hasTutorialGroup);
|
||||
|
Loading…
Reference in New Issue
Block a user