mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-28 12:58:48 +00:00
Cache callback functions
This commit is contained in:
parent
15d325e571
commit
6c07ebe992
1 changed files with 4 additions and 4 deletions
|
|
@ -13,18 +13,18 @@ const SectionsList = React.forwardRef(({ className, sections, preferences, onPre
|
|||
onPreferenceChanged(id, color);
|
||||
};
|
||||
|
||||
const updateDropdown = (event) => {
|
||||
const updateDropdown = React.useCallback((event) => {
|
||||
var data = event.currentTarget.dataset;
|
||||
onPreferenceChanged(data.name, data.value);
|
||||
};
|
||||
});
|
||||
|
||||
const checkUser = (event) => {
|
||||
const checkUser = React.useCallback((event) => {
|
||||
if(! preferences.user) {
|
||||
// Here in Stremio 4 we show a toast with a message, asking the anonymous user to log in/register
|
||||
console.log('No user found');
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Determines whether the link should be opened in new window or in the current one.
|
||||
const getTargetFor = url => ['//', 'http://', 'https://', 'file://', 'ftp://', 'mailto:', 'magnet:']
|
||||
|
|
|
|||
Loading…
Reference in a new issue