jordenc / org.telegram.api.bot

Homey Telegram communication
5 stars 6 forks source link

Cannot read property 'slice' of undefined #41

Closed jonkristian closed 1 year ago

jonkristian commented 3 years ago

Really love this app. Unfortunately it stopped working for me. Whenever i try to go into settings i get the following

Error: Cannot read property 'slice' of undefined

I've tried wiping everything and re-installing but to no avail, running Homey 5.0.4.

AdyRock commented 3 years ago

I get the same error. It seems this function: function reverse_log() {

        return this.log.slice().reverse();

    }

is the culprit. What is this.log mean to be as it is the only reference in the file?

Joolee commented 2 years ago

The whole function doesn't work right now. I guess the idea was to pull recent logs from Homey, reverse them and display them. But the whole pulling mechanism isn't implemented. You can remove the reference to renew_log from line 248 and the functionality would stay the same. New logs should still be added to the display so it's not completely broken. (Though I don't run the app so I can't test it) https://github.com/jordenc/org.telegram.api.bot/blob/master/settings/index.html#L248

jordenc commented 1 year ago

The log field will be removed in the upcoming version, which will prevent the error.