mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-08-16 15:44:49 +00:00
isProtected property dropped
This commit is contained in:
parent
e204b2f7f0
commit
1a01242fef
2 changed files with 3 additions and 8 deletions
|
|
@ -5,7 +5,7 @@ const Icon = require('stremio-icons/dom');
|
|||
const { Button } = require('stremio/common');
|
||||
const styles = require('./styles');
|
||||
|
||||
const Addon = ({ className, id, name, logo, description, types, version, transportUrl, installed, isProtected, toggle, onShareButtonClicked }) => {
|
||||
const Addon = ({ className, id, name, logo, description, types, version, transportUrl, installed, toggle, onShareButtonClicked }) => {
|
||||
const onKeyUp = React.useCallback((event) => {
|
||||
if (event.key === 'Enter' && typeof toggle === 'function') {
|
||||
toggle(event);
|
||||
|
|
@ -52,7 +52,7 @@ const Addon = ({ className, id, name, logo, description, types, version, transpo
|
|||
}
|
||||
</div>
|
||||
<div className={styles['buttons-container']}>
|
||||
<Button className={installed ? styles['uninstall-button-container'] : styles['install-button-container']} title={installed ? 'Uninstall' : 'Install'} tabIndex={-1} data-id={id} disabled={isProtected} onClick={toggle}>
|
||||
<Button className={installed ? styles['uninstall-button-container'] : styles['install-button-container']} title={installed ? 'Uninstall' : 'Install'} tabIndex={-1} data-id={id} onClick={toggle}>
|
||||
<div className={styles['label']}>{installed ? 'Uninstall' : 'Install'}</div>
|
||||
</Button>
|
||||
<Button className={styles['share-button-container']} title={'Share addon'} tabIndex={-1} onClick={onShareButtonClicked}>
|
||||
|
|
@ -74,7 +74,6 @@ Addon.propTypes = {
|
|||
version: PropTypes.string,
|
||||
transportUrl: PropTypes.string,
|
||||
installed: PropTypes.bool,
|
||||
isProtected: PropTypes.bool,
|
||||
toggle: PropTypes.func,
|
||||
onShareButtonClicked: PropTypes.func
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ const Addons = ({ urlParams, queryParams }) => {
|
|||
if (inputRef.current.value.length > 0) {
|
||||
setSelectedAddon(inputRef.current.value);
|
||||
setAddedAddon(false);
|
||||
} else {
|
||||
alert('TODO: Error message');
|
||||
}
|
||||
}, [setSelectedAddon]);
|
||||
React.useEffect(() => {
|
||||
|
|
@ -55,8 +53,7 @@ const Addons = ({ urlParams, queryParams }) => {
|
|||
event.nativeEvent.clearSelectedAddonPrevented = true;
|
||||
}, []);
|
||||
const setInstalledAddon = React.useCallback((currentAddon) => {
|
||||
return installedAddons.some((installedAddon) => installedAddon.manifest.id === currentAddon.manifest.id &&
|
||||
installedAddon.transportUrl === currentAddon.transportUrl);
|
||||
return installedAddons.some((installedAddon) => installedAddon.transportUrl === currentAddon.transportUrl);
|
||||
}, [installedAddons]);
|
||||
return (
|
||||
<div className={styles['addons-container']}>
|
||||
|
|
@ -92,7 +89,6 @@ const Addons = ({ urlParams, queryParams }) => {
|
|||
{...addon.manifest}
|
||||
key={index}
|
||||
installed={setInstalledAddon(addon)}
|
||||
isProtected={addon.flags && addon.flags.protected}
|
||||
className={styles['addon']}
|
||||
toggle={() => setSelectedAddon(addon.transportUrl)}
|
||||
onShareButtonClicked={() => setSharedAddon(addon)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue