lemmy-ui/src/shared/initialize.ts

10 lines
311 B
TypeScript
Raw Normal View History

2020-10-26 07:09:44 +00:00
import { GetSiteResponse } from 'lemmy-js-client';
import { UserService } from './services';
import { i18n } from './i18next';
import { getLanguage } from './utils';
export const initializeSite = (site: GetSiteResponse) => {
UserService.Instance.user = site.my_user;
i18n.changeLanguage(getLanguage());
};