Merge pull request #1024 from ONLYOFFICE/bugfix/editor-optimization

Bugfix/editor optimization
This commit is contained in:
Alexey Safronov 2022-11-11 17:25:35 +03:00 committed by GitHub
commit a618ba5d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -50,10 +50,12 @@ class AuthStore {
makeAutoObservable(this);
}
init = async () => {
init = async (skipRequest = false) => {
if (this.isInit) return;
this.isInit = true;
this.skipRequest = skipRequest;
try {
await this.userStore.init();
} catch (e) {
@ -63,7 +65,7 @@ class AuthStore {
const requests = [];
requests.push(this.settingsStore.init());
if (this.isAuthenticated) {
if (this.isAuthenticated && !skipRequest) {
requests.push(
this.currentQuotaStore.init(),
this.currentTariffStatusStore.init()

View File

@ -681,7 +681,10 @@ class SettingsStore {
};
getAppearanceTheme = async () => {
const res = await api.settings.getAppearanceTheme();
let res = null;
if (window?.__ASC_INITIAL_EDITOR_STATE__?.appearanceTheme)
res = window.__ASC_INITIAL_EDITOR_STATE__.appearanceTheme;
else res = await api.settings.getAppearanceTheme();
const currentColorScheme = res.themes.find((theme) => {
return res.selected === theme.id;

View File

@ -6,6 +6,7 @@ import {
getSettings,
getBuildVersion,
getCurrentCustomSchema,
getAppearanceTheme,
} from "@docspace/common/api/settings";
import combineUrl from "@docspace/common/utils/combineUrl";
import { AppServerConfig } from "@docspace/common/constants";
@ -69,12 +70,14 @@ export const initDocEditor = async (req) => {
filesSettings,
versionInfo,
customNames,
appearanceTheme,
] = await Promise.all([
getUser(),
getSettings(),
getSettingsFiles(),
getBuildVersion(),
getCurrentCustomSchema("Common"),
getAppearanceTheme(),
]);
const successAuth = !!user;
@ -124,6 +127,7 @@ export const initDocEditor = async (req) => {
portalSettings: settings,
versionInfo,
customNames,
appearanceTheme,
};
} catch (err) {
error = { errorMessage: typeof err === "string" ? err : err.message };