lemmy-ui/src/shared/initialize.ts

10 lines
316 B
TypeScript
Raw Normal View History

2021-02-22 02:39:04 +00:00
import { GetSiteResponse } from "lemmy-js-client";
import { UserService } from "./services";
import { i18n } from "./i18next";
import { getLanguage } from "./utils";
2020-10-26 07:09:44 +00:00
2020-10-26 18:42:07 +00:00
export function initializeSite(site: GetSiteResponse) {
2021-03-15 18:09:31 +00:00
UserService.Instance.localUserView = site.my_user;
2020-10-26 07:09:44 +00:00
i18n.changeLanguage(getLanguage());
2020-10-26 18:42:07 +00:00
}