valverde-marcelo / kodi2webos

A Kodi client for LG Smart TVs with webOS - using EnactJS - Moonstone
90 stars 25 forks source link

getGenres is not a function #3

Open 1660063-StarJv-HCMUS opened 4 years ago

1660063-StarJv-HCMUS commented 4 years ago

i try to install and run app, but my console show bug 'getGenres is not a function in /src/views/LoadingPanel.js' Capture

valverde-marcelo commented 4 years ago

Are you executing in demo mode?

getGenres is not implemented in mock api, only in real api. skip this error by commenting out the lines, or implement the getGenres function in the mock api

valverde-marcelo commented 4 years ago

you need to check the value of the DEMO_MODE variable this variable is stored in localstorage

/src/api/index.js

const api = storage.getSync(DEMO_MODE, LOCAL_STORAGE_PREFIX_SERVER) ? mockAPI : realAPI;

export default api;

this variable is set to true on first access, here: /src/views/LoadingPanel.js

if (storage.getSync("access", LOCAL_STORAGE_PREFIX_SERVER) === null) { ... storage.setSync("protocol", PROTOCOL_HTTP, LOCAL_STORAGE_PREFIX_SERVER); storage.setSync(DEMO_MODE, true, LOCAL_STORAGE_PREFIX_SERVER);

....