Added use password option to saved settings
This commit is contained in:
parent
ae98b54c7b
commit
485b893fc6
@ -1,10 +1,12 @@
|
||||
import React, { useState, useContext, useRef } from "react";
|
||||
import React, { useContext, useRef } from "react";
|
||||
import { Box, Label, Input, Button, Flex, Checkbox } from "theme-ui";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import shortid from "shortid";
|
||||
|
||||
import AuthContext from "../contexts/AuthContext";
|
||||
|
||||
import useSetting from "../helpers/useSetting";
|
||||
|
||||
import Modal from "../components/Modal";
|
||||
|
||||
function StartModal({ isOpen, onRequestClose }) {
|
||||
@ -15,7 +17,7 @@ function StartModal({ isOpen, onRequestClose }) {
|
||||
setPassword(event.target.value);
|
||||
}
|
||||
|
||||
const [usePassword, setUsePassword] = useState(true);
|
||||
const [usePassword, setUsePassword] = useSetting("game.usePassword");
|
||||
function handleUsePasswordChange(event) {
|
||||
setUsePassword(event.target.checked);
|
||||
}
|
||||
|
@ -32,6 +32,11 @@ function loadVersions(settings) {
|
||||
...prev,
|
||||
map: { fullScreen: false, labelSize: 1 },
|
||||
}));
|
||||
// v1.7.0 - Added game password
|
||||
settings.version(3, (prev) => ({
|
||||
...prev,
|
||||
game: { usePassword: true },
|
||||
}));
|
||||
}
|
||||
|
||||
export function getSettings() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user