DocSpace-client/packages/asc-web-common/store/SettingsStore.js

326 lines
8.6 KiB
JavaScript
Raw Normal View History

2021-02-02 09:55:14 +00:00
import { action, computed, makeObservable, observable } from "mobx";
import api from "../api";
Merge branch 'develop' into feature/mobx # Conflicts: # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js # products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.Files/Client/src/components/pages/Home/index.js # products/ASC.Files/Client/src/store/files/selectors.js # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.People/Client/src/components/pages/Home/index.js # products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/src/store/group/actions.js # products/ASC.People/Client/src/store/people/actions.js # products/ASC.People/Client/src/store/people/selectors.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/src/components/pages/About/index.js # web/ASC.Web.Client/src/components/pages/Home/index.js # web/ASC.Web.Client/src/store/settings/actions.js # web/ASC.Web.Common/src/components/Layout/index.js # web/ASC.Web.Common/src/components/NavMenu/index.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-nav.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-unauth.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/nav-item.js # web/ASC.Web.Common/src/components/PageLayout/index.js # web/ASC.Web.Common/src/store/auth/actions.js # web/ASC.Web.Common/src/store/auth/reducer.js # web/ASC.Web.Common/src/store/auth/selectors.js # web/ASC.Web.Components/src/components/loader/types/rombs.js
2021-02-20 14:31:58 +00:00
import { ARTICLE_PINNED_KEY, LANGUAGE } from "../constants";
import { combineUrl } from "../utils";
import { AppServerConfig } from "../constants";
const { proxyURL } = AppServerConfig;
class SettingsStore {
2021-02-03 12:42:47 +00:00
isLoading = false;
isLoaded = false;
2021-02-02 09:55:14 +00:00
currentProductId = "";
culture = "en-US";
cultures = [];
trustedDomains = [];
trustedDomainsType = 1;
timezone = "UTC";
timezones = [];
utcOffset = "00:00:00";
utcHoursOffset = 0;
defaultPage = combineUrl(proxyURL, "/");
homepage = "";
2021-02-02 09:55:14 +00:00
datePattern = "M/d/yyyy";
datePatternJQ = "00/00/0000";
dateTimePattern = "dddd, MMMM d, yyyy h:mm:ss tt";
datepicker = {
datePattern: "mm/dd/yy",
dateTimePattern: "DD, mm dd, yy h:mm:ss tt",
2021-02-02 09:55:14 +00:00
timePattern: "h:mm tt",
};
2021-02-02 09:55:14 +00:00
organizationName = "ONLYOFFICE";
greetingSettings = "Web Office Applications";
enableAdmMess = false;
urlLicense = "https://gnu.org/licenses/gpl-3.0.html";
urlSupport = "https://helpdesk.onlyoffice.com/";
2021-03-22 14:35:33 +00:00
logoUrl = combineUrl(proxyURL, "/static/images/nav.logo.opened.react.svg");
2021-02-02 09:55:14 +00:00
customNames = {
id: "Common",
userCaption: "User",
usersCaption: "Users",
groupCaption: "Group",
groupsCaption: "Groups",
userPostCaption: "Title",
regDateCaption: "Registration Date",
groupHeadCaption: "Head",
guestCaption: "Guest",
guestsCaption: "Guests",
};
2021-02-03 12:42:47 +00:00
isDesktopClient = window["AscDesktopEditor"] !== undefined;
2021-02-02 09:55:14 +00:00
//isDesktopEncryption: desktopEncryption;
isEncryptionSupport = false;
encryptionKeys = null;
Merge branch 'develop' into feature/mobx # Conflicts: # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js # products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.Files/Client/src/components/pages/Home/index.js # products/ASC.Files/Client/src/store/files/selectors.js # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.People/Client/src/components/pages/Home/index.js # products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/src/store/group/actions.js # products/ASC.People/Client/src/store/people/actions.js # products/ASC.People/Client/src/store/people/selectors.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/src/components/pages/About/index.js # web/ASC.Web.Client/src/components/pages/Home/index.js # web/ASC.Web.Client/src/store/settings/actions.js # web/ASC.Web.Common/src/components/Layout/index.js # web/ASC.Web.Common/src/components/NavMenu/index.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-nav.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-unauth.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/nav-item.js # web/ASC.Web.Common/src/components/PageLayout/index.js # web/ASC.Web.Common/src/store/auth/actions.js # web/ASC.Web.Common/src/store/auth/reducer.js # web/ASC.Web.Common/src/store/auth/selectors.js # web/ASC.Web.Components/src/components/loader/types/rombs.js
2021-02-20 14:31:58 +00:00
isHeaderVisible = false;
2021-02-02 09:55:14 +00:00
isTabletView = false;
2021-02-23 09:00:44 +00:00
isArticlePinned =
localStorage.getItem(ARTICLE_PINNED_KEY) === "true" || false;
Merge branch 'develop' into feature/mobx # Conflicts: # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js # products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.Files/Client/src/components/pages/Home/index.js # products/ASC.Files/Client/src/store/files/selectors.js # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.People/Client/src/components/pages/Home/index.js # products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/src/store/group/actions.js # products/ASC.People/Client/src/store/people/actions.js # products/ASC.People/Client/src/store/people/selectors.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/src/components/pages/About/index.js # web/ASC.Web.Client/src/components/pages/Home/index.js # web/ASC.Web.Client/src/store/settings/actions.js # web/ASC.Web.Common/src/components/Layout/index.js # web/ASC.Web.Common/src/components/NavMenu/index.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-nav.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-unauth.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/nav-item.js # web/ASC.Web.Common/src/components/PageLayout/index.js # web/ASC.Web.Common/src/store/auth/actions.js # web/ASC.Web.Common/src/store/auth/reducer.js # web/ASC.Web.Common/src/store/auth/selectors.js # web/ASC.Web.Components/src/components/loader/types/rombs.js
2021-02-20 14:31:58 +00:00
2021-02-02 09:55:14 +00:00
hashSettings = null;
2021-02-03 12:42:47 +00:00
title = "";
2021-02-03 14:34:26 +00:00
ownerId = null;
nameSchemaId = null;
2021-02-15 19:43:07 +00:00
owner = {};
2021-03-18 18:54:03 +00:00
wizardToken = null;
2021-02-15 19:43:07 +00:00
passwordSettings = null;
2021-03-19 16:02:43 +00:00
hasShortenService = false;
constructor() {
2021-02-02 09:55:14 +00:00
makeObservable(this, {
currentProductId: observable,
culture: observable,
cultures: observable,
trustedDomains: observable,
trustedDomainsType: observable,
timezone: observable,
timezones: observable,
utcOffset: observable,
utcHoursOffset: observable,
defaultPage: observable,
homepage: observable,
datePattern: observable,
datePatternJQ: observable,
dateTimePattern: observable,
datepicker: observable,
organizationName: observable,
greetingSettings: observable,
enableAdmMess: observable,
urlLicense: observable,
urlSupport: observable,
urlAuthKeys: computed,
logoUrl: observable,
customNames: observable,
isDesktopClient: observable,
isEncryptionSupport: observable,
encryptionKeys: observable,
Merge branch 'develop' into feature/mobx # Conflicts: # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js # products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.Files/Client/src/components/pages/Home/index.js # products/ASC.Files/Client/src/store/files/selectors.js # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.People/Client/src/components/pages/Home/index.js # products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/src/store/group/actions.js # products/ASC.People/Client/src/store/people/actions.js # products/ASC.People/Client/src/store/people/selectors.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/src/components/pages/About/index.js # web/ASC.Web.Client/src/components/pages/Home/index.js # web/ASC.Web.Client/src/store/settings/actions.js # web/ASC.Web.Common/src/components/Layout/index.js # web/ASC.Web.Common/src/components/NavMenu/index.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-nav.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-unauth.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/nav-item.js # web/ASC.Web.Common/src/components/PageLayout/index.js # web/ASC.Web.Common/src/store/auth/actions.js # web/ASC.Web.Common/src/store/auth/reducer.js # web/ASC.Web.Common/src/store/auth/selectors.js # web/ASC.Web.Components/src/components/loader/types/rombs.js
2021-02-20 14:31:58 +00:00
isHeaderVisible: observable,
2021-02-02 09:55:14 +00:00
isTabletView: observable,
Merge branch 'develop' into feature/mobx # Conflicts: # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js # products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.Files/Client/src/components/pages/Home/index.js # products/ASC.Files/Client/src/store/files/selectors.js # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.People/Client/src/components/pages/Home/index.js # products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/src/store/group/actions.js # products/ASC.People/Client/src/store/people/actions.js # products/ASC.People/Client/src/store/people/selectors.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/src/components/pages/About/index.js # web/ASC.Web.Client/src/components/pages/Home/index.js # web/ASC.Web.Client/src/store/settings/actions.js # web/ASC.Web.Common/src/components/Layout/index.js # web/ASC.Web.Common/src/components/NavMenu/index.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-nav.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-unauth.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/nav-item.js # web/ASC.Web.Common/src/components/PageLayout/index.js # web/ASC.Web.Common/src/store/auth/actions.js # web/ASC.Web.Common/src/store/auth/reducer.js # web/ASC.Web.Common/src/store/auth/selectors.js # web/ASC.Web.Components/src/components/loader/types/rombs.js
2021-02-20 14:31:58 +00:00
isArticlePinned: observable,
2021-02-02 09:55:14 +00:00
hashSettings: observable,
2021-02-03 14:34:26 +00:00
ownerId: observable,
nameSchemaId: observable,
2021-03-18 18:54:03 +00:00
wizardToken: observable,
wizardCompleted: computed,
2021-03-17 13:35:45 +00:00
passwordSettings: observable,
2021-03-19 16:02:43 +00:00
hasShortenService: observable,
2021-02-02 09:55:14 +00:00
getSettings: action,
getCurrentCustomSchema: action,
getPortalSettings: action,
2021-02-03 12:42:47 +00:00
init: action,
isLoaded: observable,
isLoading: observable,
setIsLoading: action,
setIsLoaded: action,
getPortalCultures: action,
getIsEncryptionSupport: action,
updateEncryptionKeys: action,
setEncryptionKeys: action,
getEncryptionKeys: action,
setModuleInfo: action,
2021-02-15 19:43:07 +00:00
setCurrentProductId: action,
setWizardComplete: action,
setPasswordSettings: action,
getPortalPasswordSettings: action,
setTimezones: action,
Merge branch 'develop' into feature/mobx # Conflicts: # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js # products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.Files/Client/src/components/pages/Home/index.js # products/ASC.Files/Client/src/store/files/selectors.js # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.People/Client/src/components/pages/Home/index.js # products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/src/store/group/actions.js # products/ASC.People/Client/src/store/people/actions.js # products/ASC.People/Client/src/store/people/selectors.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/src/components/pages/About/index.js # web/ASC.Web.Client/src/components/pages/Home/index.js # web/ASC.Web.Client/src/store/settings/actions.js # web/ASC.Web.Common/src/components/Layout/index.js # web/ASC.Web.Common/src/components/NavMenu/index.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-nav.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-unauth.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/nav-item.js # web/ASC.Web.Common/src/components/PageLayout/index.js # web/ASC.Web.Common/src/store/auth/actions.js # web/ASC.Web.Common/src/store/auth/reducer.js # web/ASC.Web.Common/src/store/auth/selectors.js # web/ASC.Web.Components/src/components/loader/types/rombs.js
2021-02-20 14:31:58 +00:00
getPortalTimezones: action,
setHeaderVisible: action,
setIsTabletView: action,
setValue: action,
setArticlePinned: action,
2021-03-24 13:49:42 +00:00
getSerializedProfile: action,
2021-02-02 09:55:14 +00:00
});
}
2021-02-02 09:55:14 +00:00
get urlAuthKeys() {
const splitted = this.culture.split("-");
const lang = splitted.length > 0 ? splitted[0] : "en";
return `https://helpcenter.onlyoffice.com/${lang}/installation/groups-authorization-keys.aspx`;
}
2021-03-18 18:54:03 +00:00
get wizardCompleted() {
return this.isLoaded && !this.wizardToken;
}
setValue = (key, value) => {
this[key] = value;
};
2021-03-18 18:54:03 +00:00
2021-02-02 09:55:14 +00:00
getSettings = async () => {
const newSettings = await api.settings.getSettings();
2021-02-02 09:55:14 +00:00
Object.keys(newSettings).map((key) => {
2021-02-03 14:06:47 +00:00
if (key in this) {
this.setValue(
key,
key === "defaultPage"
? combineUrl(proxyURL, newSettings[key])
: newSettings[key]
);
2021-02-02 09:55:14 +00:00
if (key === "culture" && !localStorage.getItem(LANGUAGE)) {
localStorage.setItem(LANGUAGE, newSettings[key]);
}
} else if (key === "passwordHash") {
this.setValue("hashSettings", newSettings[key]);
2021-02-02 09:55:14 +00:00
}
});
2021-02-02 09:55:14 +00:00
return newSettings;
};
2021-02-02 09:55:14 +00:00
getCurrentCustomSchema = async (id) => {
this.customNames = await api.settings.getCurrentCustomSchema(id);
};
2021-02-02 09:55:14 +00:00
getPortalSettings = async () => {
const origSettings = await this.getSettings();
if (origSettings.nameSchemaId) {
this.getCurrentCustomSchema(origSettings.nameSchemaId);
}
};
2021-02-03 12:42:47 +00:00
init = async () => {
this.setIsLoading(true);
await this.getPortalSettings();
this.setIsLoading(false);
this.setIsLoaded(true);
};
setIsLoading = (isLoading) => {
this.isLoading = isLoading;
};
setIsLoaded = (isLoaded) => {
this.isLoaded = isLoaded;
};
getPortalCultures = async () => {
this.cultures = await api.settings.getPortalCultures();
};
getIsEncryptionSupport = async () => {
this.isEncryptionSupport = await api.files.getIsEncryptionSupport();
};
updateEncryptionKeys = (encryptionKeys) => {
this.encryptionKeys = encryptionKeys ?? {};
};
setEncryptionKeys = async (keys) => {
await api.files.setEncryptionKeys(keys);
this.updateEncryptionKeys(keys);
};
getEncryptionKeys = async () => {
const encryptionKeys = await api.files.getEncryptionKeys();
this.updateEncryptionKeys(encryptionKeys);
};
2021-03-24 13:49:42 +00:00
getSerializedProfile = () => {
return new Promise((resolve) => {
localStorage.removeItem("profile");
const interval = setInterval(() => {
try {
const profile = localStorage.getItem("profile");
if (profile) {
localStorage.removeItem("profile");
clearInterval(interval);
resolve(profile);
}
} catch {
return;
}
}, 500);
});
};
getOAuthToken = () => {
return new Promise((resolve) => {
localStorage.removeItem("code");
const interval = setInterval(() => {
try {
const code = localStorage.getItem("code");
if (code) {
localStorage.removeItem("code");
clearInterval(interval);
resolve(code);
}
} catch {
return;
}
}, 500);
});
};
setModuleInfo = (homepage, productId) => {
if (this.homepage == homepage) return;
this.homepage = homepage;
2021-02-15 19:43:07 +00:00
this.setCurrentProductId(productId);
2021-03-22 14:35:33 +00:00
const baseElm = document.getElementsByTagName("base");
if (baseElm && baseElm.length === 1) {
const baseUrl = homepage
? homepage[homepage.length - 1] === "/"
? homepage
: `${homepage}/`
: "/";
console.log("SET base URL", baseUrl);
baseElm[0].setAttribute("href", baseUrl);
}
2021-02-15 19:43:07 +00:00
};
setCurrentProductId = (currentProductId) => {
this.currentProductId = currentProductId;
};
getPortalOwner = async () => {
const owner = await api.people.getUserById(this.ownerId);
this.owner = owner;
return owner;
};
setWizardComplete = () => {
2021-03-18 18:54:03 +00:00
this.wizardToken = null;
2021-02-15 19:43:07 +00:00
};
setPasswordSettings = (passwordSettings) => {
this.passwordSettings = passwordSettings;
};
getPortalPasswordSettings = async (confirmKey = null) => {
const settings = await api.settings.getPortalPasswordSettings(confirmKey);
this.setPasswordSettings(settings);
};
setTimezones = (timezones) => {
this.timezones = timezones;
};
getPortalTimezones = async (token = undefined) => {
const timezones = await api.settings.getPortalTimezones(token);
this.setTimezones(timezones);
};
Merge branch 'develop' into feature/mobx # Conflicts: # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js # products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.Files/Client/src/components/pages/Home/index.js # products/ASC.Files/Client/src/store/files/selectors.js # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js # products/ASC.People/Client/src/components/pages/Home/index.js # products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/src/store/group/actions.js # products/ASC.People/Client/src/store/people/actions.js # products/ASC.People/Client/src/store/people/selectors.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/src/components/pages/About/index.js # web/ASC.Web.Client/src/components/pages/Home/index.js # web/ASC.Web.Client/src/store/settings/actions.js # web/ASC.Web.Common/src/components/Layout/index.js # web/ASC.Web.Common/src/components/NavMenu/index.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-nav.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header-unauth.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/header.js # web/ASC.Web.Common/src/components/NavMenu/sub-components/nav-item.js # web/ASC.Web.Common/src/components/PageLayout/index.js # web/ASC.Web.Common/src/store/auth/actions.js # web/ASC.Web.Common/src/store/auth/reducer.js # web/ASC.Web.Common/src/store/auth/selectors.js # web/ASC.Web.Components/src/components/loader/types/rombs.js
2021-02-20 14:31:58 +00:00
setHeaderVisible = (isHeaderVisible) => {
this.isHeaderVisible = isHeaderVisible;
};
setIsTabletView = (isTabletView) => {
this.isTabletView = isTabletView;
};
setArticlePinned = (isPinned) => {
isPinned
? localStorage.setItem(ARTICLE_PINNED_KEY, isPinned)
: localStorage.removeItem(ARTICLE_PINNED_KEY);
this.isArticlePinned = isPinned;
};
}
export default SettingsStore;