[weather] Fix broken observation display for temperature of 0 °
ClosedPublic

Authored by kossebau on Sun, Nov 18, 2:27 PM.

Details

Summary

For that also deduplicate any data extraction & conversion logic
in helper methods for consistency

Test Plan

Observation temperature of 0 ° no longer is shown as empty string,
all other data is shown as before (tested by hardcoding 0 as temperature in
the dataengine, to not have to wait for the next evening ;) ).

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Sun, Nov 18, 2:27 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSun, Nov 18, 2:27 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Sun, Nov 18, 2:27 PM

Observation temperature of 0 ° no longer is shown as empty string,

Classic JS! well found.

It looks OK to me, but hopefully @broulik can have a look as quirky JS is his specialty.

kossebau updated this revision to Diff 45985.Thu, Nov 22, 1:39 AM
  • use var data = weatherDataSource.currentData || {}; to simplify rest
  • use typeof number !== "undefined"
kossebau updated this revision to Diff 45986.Thu, Nov 22, 1:41 AM

diff against correct branch

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Nov 23, 3:59 AM
This revision was automatically updated to reflect the committed changes.