[gnome-documents] embed: Unbreak launch-search



commit a3fb33394c00d7003483133d7b166dbe1ca6ba34
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 13 19:07:35 2015 +0100

    embed: Unbreak launch-search
    
    When we build the UI for the second time, the TrackerControllers are
    not restarted, which causes the query-status-changed handler to
    restore the view even before the mode could be set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744643

 src/embed.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index fbe987c..bd53f72 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013 Red Hat, Inc.
+ * Copyright (c) 2011, 2013, 2015 Red Hat, Inc.
  *
  * Gnome Documents is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by the
@@ -190,8 +190,11 @@ const Embed = new Lang.Class({
     },
 
     _restoreLastPage: function() {
-        let page;
         let windowMode = Application.modeController.getWindowMode();
+        if (windowMode == WindowMode.WindowMode.NONE)
+            return;
+
+        let page;
 
         switch (windowMode) {
         case WindowMode.WindowMode.COLLECTIONS:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]