Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hideWhenEmpty not working #87

Open
BoujeeBoba opened this issue Dec 10, 2020 · 5 comments
Open

hideWhenEmpty not working #87

BoujeeBoba opened this issue Dec 10, 2020 · 5 comments

Comments

@BoujeeBoba
Copy link

I have enabled the hideWhenEmpty parameter for this module but I can't get the header to disappear when the list is empty. The code in my config is setup as shown here:

{
		module: 'MMM-Todoist',
		position: 'top_left',	// This can be any of the regions. Best results in left or right regions.
		header: 'To Do List', // This is optional
		config: { // See 'Configuration options' for more information.
			hideWhenEmpty: true,
			accessToken: '...',
			maximumEntries: 5,
			updateInterval: 10*60*1000, // Update every 10 minutes
			fade: false,
			showProject:false,      
			//projects and/or labels is mandatory:
			projects: [ ... ] 
			//labels: [ "MagicMirror", "Important" ] // Tasks for any projects with these labels will be shown.
  			}
	},

I have waited for the mirror to refresh as well as start the mirror with an empty list and the header still appears, has anyone else run into this issue?

@addfozzie
Copy link

Yup I have the same. End up having to leave a single item in the list. When this is used as a shopping list there can be a lot of milk bought when it isn't needed. :)

@Rodriguezjp
Copy link

the same problem !!!!I don't want to buy more milk !!!
How could we make the header disappear? when the list is empty ...Thx!!

@ckboyle
Copy link

ckboyle commented Mar 9, 2021

I believe there's a related issue that can come up caused by the check of this.tasks.items.length on line 564 throwing an error because that value is undefined at the time. It was causing other widgets on my page to not render.

I'd love to throw in a PR, I just don't have a dev setup for working on MM modules right now, but if I can get one together I'll try and get a PR together.

@Eagle2301
Copy link

Eagle2301 commented Mar 10, 2021

Same problem here.
the check of this.tasks.items.length on line 564 causing other widgets on my page to not render.
If I put false in "hideWhenEmpty" nothing is display on Todoist, but other widgets working.

@schramkef
Copy link

Same here.
When 'hideWhenEmpty: true' it throws

TypeError: Cannot read property 'items' of undefined at Class.getDom (MMM-Todoist.js:564)

`getDom: function () {

	if (this.config.hideWhenEmpty && this.tasks.items.length===0) {
		return null;
	}`

This prevents following modules to load.
Workaround is to set 'hideWhenEmpty: false'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants