Fixes for view url-sync

This commit is contained in:
Paulus Schoutsen 2016-01-25 22:45:49 -08:00
parent 917f9d8519
commit 485ad9f033
3 changed files with 7 additions and 4 deletions

View File

@ -20,7 +20,7 @@
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
"license": "MIT",
"dependencies": {
"home-assistant-js": "git+https://github.com/balloob/home-assistant-js.git#7d7f8077f5faf201ba9a1133c0a50b19c32bfa1c",
"home-assistant-js": "git+https://github.com/balloob/home-assistant-js.git#eee4f5060fb66327a44ff4f9ecba81d927481e79",
"lodash": "^3.10.0",
"moment": "^2.11.1"
},

View File

@ -89,7 +89,7 @@ export default new Polymer({
return;
}
navigator.serviceWorker.register('./service_worker.js').catch(err => {
navigator.serviceWorker.register('/service_worker.js').catch(err => {
if (__DEV__) {
/* eslint-disable no-console */
console.warn('Unable to register service worker', err);

View File

@ -150,7 +150,10 @@ export default new Polymer({
},
viewSelected(ev) {
const section = ev.detail.item.getAttribute('data-entity') || null;
this.async(() => viewActions.selectView(section), 0);
const view = ev.detail.item.getAttribute('data-entity') || null;
const current = this.currentView || null;
if (view !== current) {
this.async(() => viewActions.selectView(view), 0);
}
},
});