From 0a8969572203935130d608a7f64183a8ccc5e690 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sun, 19 May 2019 09:58:30 -0400 Subject: [PATCH] updateAllOpenWindows when pulling repo --- doc/notes.txt | 1 - src/ui.ts | 1 + src/windows.ts | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/notes.txt b/doc/notes.txt index 2f0bc895..56cd4611 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -146,7 +146,6 @@ TODO: - handle overwrite logic - test edge/failure cases - what to do about included files? - - what if files already open in editor - can published files retain path? - what if import interrupted and partial files? - CORS for some blobs? diff --git a/src/ui.ts b/src/ui.ts index 86a402e6..f4c3d8f3 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -521,6 +521,7 @@ function _pullProjectFromGithub(e) { setWaitDialog(true); getGithubService().pull(ghurl).then( (sess:GHSession) => { setWaitDialog(false); + projectWindows.updateAllOpenWindows(store); }); } diff --git a/src/windows.ts b/src/windows.ts index 3e4de533..4964bfc8 100644 --- a/src/windows.ts +++ b/src/windows.ts @@ -135,4 +135,14 @@ export class ProjectWindows { } } + updateAllOpenWindows(store) { + for (var fileid in this.id2window) { + var wnd = this.id2window[fileid]; + if (wnd && wnd.setText) { + store.getItem(fileid).then((data) => { + this.updateFile(fileid, data); + }); + } + } + } };