|
3 | 3 | * Released under the GNU General Public License v3.0
|
4 | 4 | */
|
5 | 5 |
|
6 |
| -const version = "4.56.0"; |
| 6 | +const version = "4.56.1"; |
7 | 7 | const defaultConfig = {
|
8 | 8 | enabled: false,
|
9 | 9 | enabled_on_views: [],
|
@@ -762,10 +762,10 @@ function updateConfig() {
|
762 | 762 | }
|
763 | 763 |
|
764 | 764 | function getActiveBrowserModPopups() {
|
| 765 | + const popups = []; |
765 | 766 | if (!browserId) {
|
766 |
| - return null; |
| 767 | + return popups; |
767 | 768 | }
|
768 |
| - const popups = []; |
769 | 769 | elHass.shadowRoot.querySelectorAll(".browser_mod-card_mod").forEach((popup) => {
|
770 | 770 | if (popup.shadowRoot && popup.shadowRoot.children.length > 0) {
|
771 | 771 | popups.push(popup);
|
@@ -2043,25 +2043,37 @@ function initWallpanel() {
|
2043 | 2043 | window.addEventListener(
|
2044 | 2044 | eventName,
|
2045 | 2045 | (event) => {
|
2046 |
| - wp.handleInteractionEvent(event); |
| 2046 | + try { |
| 2047 | + wp.handleInteractionEvent(event); |
| 2048 | + } catch (error) { |
| 2049 | + logger.error(error.stack); |
| 2050 | + } |
2047 | 2051 | },
|
2048 | 2052 | { capture: true }
|
2049 | 2053 | );
|
2050 | 2054 | });
|
2051 | 2055 | window.addEventListener("resize", () => {
|
2052 |
| - const width = this.screensaverContainer.clientWidth; |
2053 |
| - const height = this.screensaverContainer.clientHeight; |
2054 |
| - if (wp.screensaverRunning() && (wp.currentWidth != width || wp.currentHeight != height)) { |
2055 |
| - logger.debug(`Size changed from ${wp.currentWidth}x${wp.currentHeight} to ${width}x${height}`); |
2056 |
| - wp.currentWidth = width; |
2057 |
| - wp.currentHeight = height; |
2058 |
| - wp.updateShadowStyle(); |
2059 |
| - wp.setMediaDimensions(); |
| 2056 | + try { |
| 2057 | + const width = this.screensaverContainer.clientWidth; |
| 2058 | + const height = this.screensaverContainer.clientHeight; |
| 2059 | + if (wp.screensaverRunning() && (wp.currentWidth != width || wp.currentHeight != height)) { |
| 2060 | + logger.debug(`Size changed from ${wp.currentWidth}x${wp.currentHeight} to ${width}x${height}`); |
| 2061 | + wp.currentWidth = width; |
| 2062 | + wp.currentHeight = height; |
| 2063 | + wp.updateShadowStyle(); |
| 2064 | + wp.setMediaDimensions(); |
| 2065 | + } |
| 2066 | + } catch (error) { |
| 2067 | + logger.error(error.stack); |
2060 | 2068 | }
|
2061 | 2069 | });
|
2062 | 2070 | window.addEventListener("hass-more-info", () => {
|
2063 |
| - if (wp.screensaverRunning()) { |
2064 |
| - wp.moreInfoDialogToForeground(); |
| 2071 | + try { |
| 2072 | + if (wp.screensaverRunning()) { |
| 2073 | + wp.moreInfoDialogToForeground(); |
| 2074 | + } |
| 2075 | + } catch (error) { |
| 2076 | + logger.error(error.stack); |
2065 | 2077 | }
|
2066 | 2078 | });
|
2067 | 2079 | const infoBoxResizeObserver = new ResizeObserver(() => {
|
@@ -4046,7 +4058,11 @@ function startup() {
|
4046 | 4058 | }
|
4047 | 4059 |
|
4048 | 4060 | console.info(`%c🖼️ Wallpanel version ${version}`, "color: #34b6f9; font-weight: bold;");
|
4049 |
| -waitForEnv(startup); |
| 4061 | +try { |
| 4062 | + waitForEnv(startup); |
| 4063 | +} catch (error) { |
| 4064 | + logger.error(error.stack); |
| 4065 | +} |
4050 | 4066 |
|
4051 | 4067 | /**
|
4052 | 4068 | * https://github.com/exif-js/exif-js
|
|
0 commit comments