Commit 96200d9b authored by Jeevan Shikaram's avatar Jeevan Shikaram Committed by Commit Bot

[App Management] Fix App Info dialog.

This CL checks that the apps have been loaded before checking if
an app exists in the apps list. It also handles a race condition
where the dom-switch element's onRouteChanged is called before
the dom-switch has a child loaded.

Bug: 1014919
Change-Id: Id0712b74b006580bfbed2c701a3e61320094a036
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1889274
Commit-Queue: Jeevan Shikaram <jshikaram@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710756}
parent 1cf90b2b
......@@ -44,8 +44,9 @@ Polymer({
}
const appId = settings.getQueryParameters().get('id');
const apps = this.getState().apps;
if (!this.getState().apps[appId]) {
if (!apps[appId] && Object.entries(apps).length !== 0) {
// TODO(crbug.com/1010398): this call does not open the main page.
app_management.util.openMainPage();
return;
......
......@@ -109,6 +109,10 @@ Polymer({
}
if (newRouteId === null) {
if (this.selectedChild_ === null) {
return;
}
this.parentNode.removeChild(this.selectedChild_);
this.selectedChild_ = null;
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment