mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
Fix updating file: check onOutdatedVersion event
This commit is contained in:
@ -383,6 +383,7 @@
|
||||
_config.editorConfig.canSaveDocumentToBinary = _config.events && !!_config.events.onSaveDocument;
|
||||
_config.editorConfig.canStartFilling = _config.events && !!_config.events.onRequestStartFilling;
|
||||
_config.editorConfig.canRequestRefreshFile = _config.events && !!_config.events.onRequestRefreshFile;
|
||||
_config.editorConfig.canUpdateVersion = _config.events && !!_config.events.onOutdatedVersion;
|
||||
_config.frameEditorId = placeholderId;
|
||||
_config.parentOrigin = window.location.origin;
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ class CommentsController extends Component {
|
||||
/** coauthoring end **/
|
||||
}
|
||||
|
||||
this.curUserId = this.props.users.currentUser.asc_getIdOriginal();
|
||||
this.curUserId = this.props.users.currentUser ? this.props.users.currentUser.asc_getIdOriginal() : '';
|
||||
});
|
||||
}
|
||||
onApiActiveSheetChanged (index) {
|
||||
|
||||
@ -785,10 +785,11 @@ define([
|
||||
_.defer(function() {
|
||||
Common.Gateway.updateVersion();
|
||||
if (callback) callback.call(me);
|
||||
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
me.editorConfig && me.editorConfig.canUpdateVersion && me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
})
|
||||
}
|
||||
});
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
},
|
||||
|
||||
onLicenseChanged: function(params) {
|
||||
|
||||
@ -2594,7 +2594,7 @@ define([
|
||||
_.defer(function() {
|
||||
Common.Gateway.updateVersion();
|
||||
if (callback) callback.call(me);
|
||||
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
me.editorConfig && me.editorConfig.canUpdateVersion && me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
})
|
||||
}});
|
||||
this.disableEditing(true, 'not-loaded');
|
||||
|
||||
@ -1362,6 +1362,7 @@ class MainController extends Component {
|
||||
|
||||
this.needToUpdateVersion = true;
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], Asc.c_oAscAsyncAction['Open']);
|
||||
|
||||
f7.dialog.alert(
|
||||
_t.errorUpdateVersion,
|
||||
@ -1371,8 +1372,9 @@ class MainController extends Component {
|
||||
if (callback) {
|
||||
callback.call(this);
|
||||
}
|
||||
Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
this.editorConfig && this.editorConfig.canUpdateVersion && Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
});
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
onDocumentName () {
|
||||
|
||||
@ -2211,7 +2211,7 @@ define([
|
||||
_.defer(function() {
|
||||
Common.Gateway.updateVersion();
|
||||
if (callback) callback.call(me);
|
||||
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
me.editorConfig && me.editorConfig.canUpdateVersion && me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@ -2081,7 +2081,7 @@ define([
|
||||
_.defer(function() {
|
||||
Common.Gateway.updateVersion();
|
||||
if (callback) callback.call(me);
|
||||
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
me.editorConfig && me.editorConfig.canUpdateVersion && me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@ -765,6 +765,7 @@ class MainController extends Component {
|
||||
|
||||
this.needToUpdateVersion = true;
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], Asc.c_oAscAsyncAction['Open']);
|
||||
|
||||
f7.dialog.alert(
|
||||
_t.errorUpdateVersion,
|
||||
@ -774,8 +775,9 @@ class MainController extends Component {
|
||||
if (callback) {
|
||||
callback.call(this);
|
||||
}
|
||||
Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
this.editorConfig && this.editorConfig.canUpdateVersion && Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
});
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
onServerVersion (buildVersion) {
|
||||
|
||||
@ -2519,7 +2519,7 @@ define([
|
||||
_.defer(function() {
|
||||
Common.Gateway.updateVersion();
|
||||
if (callback) callback.call(me);
|
||||
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
me.editorConfig && me.editorConfig.canUpdateVersion && me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@ -1120,6 +1120,7 @@ class MainController extends Component {
|
||||
|
||||
this.needToUpdateVersion = true;
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], Asc.c_oAscAsyncAction['Open']);
|
||||
|
||||
f7.dialog.alert(
|
||||
_t.errorUpdateVersion,
|
||||
@ -1129,8 +1130,9 @@ class MainController extends Component {
|
||||
if (callback) {
|
||||
callback.call(this);
|
||||
}
|
||||
Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
this.editorConfig && this.editorConfig.canUpdateVersion && Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
});
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
onServerVersion (buildVersion) {
|
||||
|
||||
@ -1705,7 +1705,7 @@ define([
|
||||
_.defer(function() {
|
||||
Common.Gateway.updateVersion();
|
||||
if (callback) callback.call(me);
|
||||
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
me.editorConfig && me.editorConfig.canUpdateVersion && me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@ -527,6 +527,7 @@ class MainController extends Component {
|
||||
|
||||
this.needToUpdateVersion = true;
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], Asc.c_oAscAsyncAction['Open']);
|
||||
|
||||
f7.dialog.alert(
|
||||
_t.errorUpdateVersion,
|
||||
@ -536,8 +537,9 @@ class MainController extends Component {
|
||||
if (callback) {
|
||||
callback.call(this);
|
||||
}
|
||||
Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
this.editorConfig && this.editorConfig.canUpdateVersion && Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
});
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
onServerVersion (buildVersion) {
|
||||
|
||||
Reference in New Issue
Block a user