mirror of
https://github.com/usememos/memos.git
synced 2025-03-28 08:30:11 +01:00
chore: fix initial guide
This commit is contained in:
parent
d474d1abd0
commit
771fe394fd
@ -72,26 +72,17 @@ func (s *APIV1Service) GetSystemStatus(c echo.Context) error {
|
|||||||
ctx := c.Request().Context()
|
ctx := c.Request().Context()
|
||||||
|
|
||||||
systemStatus := SystemStatus{
|
systemStatus := SystemStatus{
|
||||||
Profile: *s.Profile,
|
Profile: *s.Profile,
|
||||||
DBSize: 0,
|
// Allow sign up by default.
|
||||||
AllowSignUp: false,
|
AllowSignUp: true,
|
||||||
DisablePasswordLogin: false,
|
MaxUploadSizeMiB: 32,
|
||||||
DisablePublicMemos: false,
|
|
||||||
MaxUploadSizeMiB: 32,
|
|
||||||
AutoBackupInterval: 0,
|
|
||||||
AdditionalStyle: "",
|
|
||||||
AdditionalScript: "",
|
|
||||||
CustomizedProfile: CustomizedProfile{
|
CustomizedProfile: CustomizedProfile{
|
||||||
Name: "memos",
|
Name: "memos",
|
||||||
LogoURL: "",
|
Locale: "en",
|
||||||
Description: "",
|
Appearance: "system",
|
||||||
Locale: "en",
|
|
||||||
Appearance: "system",
|
|
||||||
ExternalURL: "",
|
|
||||||
},
|
},
|
||||||
StorageServiceID: DefaultStorage,
|
StorageServiceID: DefaultStorage,
|
||||||
LocalStoragePath: "assets/{timestamp}_{filename}",
|
LocalStoragePath: "assets/{timestamp}_{filename}",
|
||||||
MemoDisplayWithUpdatedTs: false,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hostUserType := store.RoleHost
|
hostUserType := store.RoleHost
|
||||||
|
@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { Outlet } from "react-router-dom";
|
import { Outlet } from "react-router-dom";
|
||||||
import storage from "./helpers/storage";
|
import storage from "./helpers/storage";
|
||||||
import { getSystemColorScheme } from "./helpers/utils";
|
import { getSystemColorScheme } from "./helpers/utils";
|
||||||
|
import useNavigateTo from "./hooks/useNavigateTo";
|
||||||
import Loading from "./pages/Loading";
|
import Loading from "./pages/Loading";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
import { useGlobalStore } from "./store/module";
|
import { useGlobalStore } from "./store/module";
|
||||||
@ -11,12 +12,20 @@ import { useUserV1Store } from "./store/v1";
|
|||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
|
const navigateTo = useNavigateTo();
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore();
|
||||||
const { mode, setMode } = useColorScheme();
|
const { mode, setMode } = useColorScheme();
|
||||||
const userV1Store = useUserV1Store();
|
const userV1Store = useUserV1Store();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const { appearance, locale, systemStatus } = globalStore.state;
|
const { appearance, locale, systemStatus } = globalStore.state;
|
||||||
|
|
||||||
|
// Redirect to sign up page if no host.
|
||||||
|
useEffect(() => {
|
||||||
|
if (!systemStatus.host) {
|
||||||
|
navigateTo("/auth/signup");
|
||||||
|
}
|
||||||
|
}, [systemStatus.host]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const initialState = async () => {
|
const initialState = async () => {
|
||||||
const { user } = store.getState().user;
|
const { user } = store.getState().user;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user