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

[Alert Module] Multiple Alerts doesn't show as expected #2522

Closed
ezeholz opened this issue Apr 10, 2021 · 5 comments
Closed

[Alert Module] Multiple Alerts doesn't show as expected #2522

ezeholz opened this issue Apr 10, 2021 · 5 comments

Comments

@ezeholz
Copy link
Contributor

ezeholz commented Apr 10, 2021

I found a bug in MagicMirror

Please make sure to only submit reproducible issues. You can safely remove everything above the dividing line.
When submitting a new issue, please supply the following information:

Platform: Hyper-V Ubuntu

Node Version: v14.15.5

MagicMirror Version: 2.15.0

Description: According to issue Jopyth/MMM-Remote-Control#256, when sending multiple alerts, the alert module can't show every alert and just hide both.

Steps to Reproduce: Send one alert (I tried with a 60 seconds timer), and then send the same alert.

Expected Results:

2021-04-10 04-23-01 2

Actual Results:

2021-04-10 04-24-28 2

Configuration:

/*************** AUTO GENERATED BY REMOTE CONTROL MODULE ***************/

var config = 
{
  address: '0.0.0.0',
  electronOptions: {
    fullscreen: false
  },
  ipWhitelist: [],
  modules: [
    {
      module: 'MMM-Remote-Control',
      position: 'top_right',
      header: '',
      config: {
        showModuleApiMenu: true,
        customMenu: 'custom.json',
        secureEndpoints: false,
        classes: {
          test: {
            toggle: 'calendar'
          },
          'This is a test': {
            hide: [
              'calendar',
              'newsfeed'
            ],
            toggle: 'clock'
          },
          'this is another test': {
            show: [
              'calendar',
              'newsfeed'
            ],
            hide: [
              'clock'
            ]
          }
        }
      }
    },
    {
      module: 'updatenotification',
      position: 'top_bar',
      config: {}
    },
    {
      module: 'clock',
      position: 'top_left',
      header: '',
      config: {}
    },
    {
      module: 'calendar',
      header: 'US Holidays',
      position: 'top_left',
      config: {
        calendars: [
          {
            symbol: 'calendar-check',
            url: 'webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics'
          }
        ]
      }
    },
    {
      module: 'compliments',
      position: 'lower_third',
      classes: 'test',
      config: {}
    },
    {
      module: 'newsfeed',
      position: 'bottom_bar',
      disabled: true, // Here it's the disabled module
      config: {
        feeds: [
          {
            title: 'New York Times',
            url: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
          }
        ]
      }
    },
    {
      module: 'alert',
      header: '',
      config: {
        welcome_message: true
      }
    }
  ],
  useHttps: false,
  httpsPrivateKey: '',
  httpsCertificate: '',
  logLevel: [
    'INFO',
    'LOG',
    'WARN',
    'ERROR'
  ]
}

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}

Additional Notes: I made a fast hotfix, you could replace some lines inside https://github.com/MichMich/MagicMirror/blob/491f5aa7769a12de7f20f201de0078704c158a8d/modules/default/alert/notificationFx.js#L130

You'll have the following:

setTimeout(() => {
    this.ntf.classList.add("ns-hide");

    //callback
    this.options.onClose();
}, 25);

Select all that, and replace it with:

this.ntf.classList.add("ns-hide");

Of course that solves the issue. I tried to take the "ns-hide" part out of the function, but onClose seems to deny the normal function of the module.
I know that onClose shouldn't be dismissed, but right now it's the only way I found to bypass this bug.

Let me know if you need something else!
Cheers :D

@MichMich
Copy link
Collaborator

Feel free to send a PR!

@rejas
Copy link
Collaborator

rejas commented Apr 10, 2021

Could you provide that custom.menu json so that I can take alook too? Or what do I ahve to do to get that exmaple gif recreated on my MM?

@ezeholz
Copy link
Contributor Author

ezeholz commented Apr 10, 2021

@rejas Actually, the custommenu.json isn't important. You can reproduce it by using the Remote Control alert menu. I set the timer to 60, and click multiple times the send button.

@rejas
Copy link
Collaborator

rejas commented Apr 10, 2021

Noob question: How do I see the RemoteCOntrol alert menu?

@ezeholz
Copy link
Contributor Author

ezeholz commented Apr 10, 2021

@rejas Install MMM-Remote-Control as stated here, and enter your mirror's IP.

Of course this module isn't necessary to reproduce this bug, you can send a notification to show that alert from any other module.

@ezeholz ezeholz closed this as completed Apr 14, 2021
B1gG added a commit to B1gG/MagicMirror that referenced this issue Apr 15, 2021
* update README.md

* fix broken start scripts & yarn

* add *.env to .gitignore

* yarn

* use yarn

* install valid-url

* add custom variables

* add original main.css bak

* add color variables

* base line-height on scale

* base font sizes on rem and var(--base)

* use variables for fonts

* add custom.css.sample

* adjust new opacities

* update CHANGELOG.md

* run prettier

* add original main.css bak

* Update .gitignore

* delete useless file

* revert 'dimming' method

* change --base to --font-size

* update sample css

* Fix alerts

Fixes MagicMirrorOrg#2522

* Prettifier

* Update dependencies and lock files

* Undo README changes

* Update custom.css.sample

* Undo script changes, Update CHANGELOG

* Fixing fetch option httpsAgent to agent in calendar module (MagicMirrorOrg#466)

Co-authored-by: earlman <earl.mangulabnan@gmail.com>
Co-authored-by: Ezequiel Holzweissig <hello@ezeholz.com.ar>
Co-authored-by: Ezequiel Holzweissig <ezequielgh1999@gmail.com>
Co-authored-by: Michael Teeuw <michael@xonaymedia.nl>
Co-authored-by: veeck <veeck@neofonie.de>
Co-authored-by: config <rubbishstuff@gmx.net>
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

3 participants