Merge pull request #1024 from ONLYOFFICE/bugfix/editor-optimization
Bugfix/editor optimization
This commit is contained in:
commit
a618ba5d87
@ -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()
|
||||
|
@ -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;
|
||||
|
@ -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 };
|
||||
|
Loading…
Reference in New Issue
Block a user