From c5effdebbf2ef6ae3835e1a7d43a2c2662e952c0 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 11 Jul 2023 18:45:52 +0300 Subject: [PATCH] [all] debug --- apps/documenteditor/main/app/controller/Main.js | 6 ++---- apps/presentationeditor/main/app/controller/Main.js | 6 ++---- apps/presentationeditor/main/app/view/FileMenu.js | 4 ++++ apps/spreadsheeteditor/main/app/controller/Main.js | 6 ++---- apps/spreadsheeteditor/main/app/view/FileMenu.js | 4 ++++ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 4a054149ae..3b8856fc77 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -421,10 +421,8 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); - if( this.appOptions.isDesktopApp ){ - var desktopRecent = Common.Controllers.Desktop.recentFiles(); - if (desktopRecent && desktopRecent.length > 0) - this.editorConfig.recent = !this.editorConfig.recent ? desktopRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktopRecent); + if( Common.Controllers.Desktop.isActive() ) { + !this.editorConfig.recent && (this.editorConfig.recent = []); } this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 77206cb02a..8926ad2d37 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -378,10 +378,8 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); - if(this.appOptions.isDesktopApp){ - var desktopRecent = Common.Controllers.Desktop.recentFiles(); - if (desktopRecent && desktopRecent.length > 0) - this.editorConfig.recent = !this.editorConfig.recent ? desktopRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktopRecent); + if( Common.Controllers.Desktop.isActive() ) { + !this.editorConfig.recent && (this.editorConfig.recent = []); } this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 8177dbeca3..8198d70784 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -333,6 +333,10 @@ define([ } this.applyMode(); + if ( Common.Controllers.Desktop.isActive() ) { + Common.NotificationCenter.trigger('update:recents', Common.Controllers.Desktop.recentFiles()); + } + if ( !!this.api ) { this.panels['info'].setApi(this.api); if (this.panels['opts']) this.panels['opts'].setApi(this.api); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 2739e9753a..3a483f360a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -423,10 +423,8 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); - if(this.appOptions.isDesktopApp){ - var desktopRecent = Common.Controllers.Desktop.recentFiles(); - if (desktopRecent && desktopRecent.length > 0) - this.editorConfig.recent = !this.editorConfig.recent ? desktopRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktopRecent); + if( Common.Controllers.Desktop.isActive() ){ + !this.editorConfig.recent && (this.editorConfig.recent = []); } this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 64938ad720..df0deefbe6 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -315,6 +315,10 @@ define([ } this.applyMode(); + if ( Common.Controllers.Desktop.isActive() ) { + Common.NotificationCenter.trigger('update:recents', Common.Controllers.Desktop.recentFiles()); + } + if ( !!this.api ) { this.panels['info'].setApi(this.api); if ( this.panels['protect'] )