tutorial: update for zustand
@@ -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);
